[R] prcomp - principal components in R

zubin binabina at bellsouth.net
Mon Nov 9 18:59:59 CET 2009


All 8 variables are still in the analysis, i am just reducing the number 
of components being estimated i thought..

Example 1 component 8 variables, there is no way 1 component explains 
100% of the variance of the 8 variable data set.

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.95)
 > summary(princ)
Importance of components:
                        PC1
Standard deviation     1.38
Proportion of Variance 1.00
Cumulative Proportion  1.00

 > summary(princ)

Rotation:
                PC1
VIX0    -0.08217686
UUP0    -0.18881983
USO0     0.26647346
GLD0     0.26983923
HYG0     0.60674758
term0    0.18220237
spread0  0.61614047
TNX0     0.18111684




Daniel Malter wrote:
> 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