R language and data analysis of the five: Principal component analysis

Source: Internet
Author: User
Tags new set

History of principal component analysis:

Pearson was proposed in 1901 and then developed by Hotelling (1933) as a multivariate statistical method. Through the main components of the analysis to show the largest individual differences, but also to reduce the number of regression analysis and clustering variables, you can use the sample covariance matrix or correlation coefficient matrix as a starting point for analysis.

By linear combination of the original variables, the optimized index is obtained: The calculation of the original multiple indexes is reduced to a few optimized ones (taking up most of the shares)

The basic idea: to try to regroup many of the previously relevant indicators into a new set of integrated indicators that are independent of each other and replace the original indicators.

Retention of Ingredients: Kaiser (1960) discard the component with a eigenvalues of less than 1, preserving only the components with a eigenvalues greater than 1.

Next, the basic physiological attributes of primary school students were shared in the implementation of the R language, choosing height (x1), Weight (x2), Bust (x3) and sitting height (x4). Specific as follows:

student<-Data.frame (X1=c (148,139,160,149,159,142,153,150,151), X2=c (72, 71, (), x3=c (+,--) 77,77, X4=c, (+), (----),----------------------------------STUDENT.PR <-Princomp (student,cor=true) Summary (ST Udent.pr,loadings=true) Screeplot (student.pr,type= "lines")

Results such as:


After analysis of four indicators, 4 components were given, the importance of which was 0.887932, 0.08231182, 0.02393843, 0.005817781, and the cumulative contribution was: 0.887932, 0.97024379,

0.99418222 1.000000000 The aggregate of the various components is also shown above, the cumulative contribution of the visible ingredient 1 and component 2 has reached 95%, so the use of these two elements will fully explain the basic information of the students.


We can automatically calculate the values of each principal component by R and draw a scatter plot:

Temp<-predict (STUDENT.PR) plot (Temp[,1:2])

Results

It is found that the separation of two components is very high and ideal.



R language and data analysis of the five: Principal component analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.