[R] prcomp - principal components in R

Daniel Malter daniel at umd.edu
Mon Nov 9 18:53:02 CET 2009


In the first PCA you ask how much variance of the EIGHT (!) variables is
captured by the first, second,..., eigth principal component.

In the second PCA you ask how much variance of the THREE (!) variables is
captured by the first, second, and third principal component.

Of course you need only as many PCs as there are variables to capture 100 %
of the variance. Your "problem" thus comes from the fact that you have eight
variables in the first PCA, which requires eight PCs to capture 100%, and
that you have only three variables in the second PCA, which naturally only
requires three PCs to capture 100% of the variance.

So it's more, yes, you are missing something in this case, rather than that
something is wrong with the analyses.

HTH,
Daniel

-------------------------
cuncta stricte discussurus
-------------------------

-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von zubin
Gesendet: Monday, November 09, 2009 12:37 PM
An: r-help at r-project.org
Betreff: [R] prcomp - principal components in R

Hello, not understanding the output of prcomp, I reduce the number of
components and the output continues to show cumulative 100% of the variance
explained, which can't be the case dropping from 8 components to 3. 

How do i get the output in terms of the cumulative % of the total variance,
so when i go from total solution of 8 (8 variables in the data set), to a
reduced number of components, i can evaluate % of variance explained, or am
I missing something??

8 variables in the data set

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE)
 > summary(princ)
Importance of components:
                         PC1   PC2   PC3   PC4   PC5   PC6    PC7    PC8
Standard deviation     1.381 1.247 1.211 0.994 0.927 0.764 0.6708 0.4366
Proportion of Variance 0.238 0.194 0.183 0.124 0.107 0.073 0.0562 0.0238
Cumulative Proportion  0.238 0.433 0.616 0.740 0.847 0.920 0.9762 *1.0000*

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.75)
 > summary(princ)

Importance of components:
                         PC1   PC2   PC3
Standard deviation     1.381 1.247 1.211
Proportion of Variance 0.387 0.316 0.297 Cumulative Proportion  0.387 0.703
*1.000*

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list