[R] princomp and eigen

Murray Jorgensen maj at waikato.ac.nz
Sun Jul 16 06:12:07 CEST 2006


Consider the following output [R2.2.0; Windows XP]

 > set.seed(160706)
 > X <- matrix(rnorm(40),nrow=10,ncol=4)
 > Xpc <- princomp(X,cor=FALSE)
 > summary(Xpc,loadings=TRUE, cutoff=0)
Importance of components:
                           Comp.1    Comp.2    Comp.3     Comp.4
Standard deviation     1.2268300 0.9690865 0.7918504 0.55295970
Proportion of Variance 0.4456907 0.2780929 0.1856740 0.09054235
Cumulative Proportion  0.4456907 0.7237836 0.9094576 1.00000000

Loadings:
      Comp.1 Comp.2 Comp.3 Comp.4
[1,] -0.405 -0.624  0.466  0.479
[2,] -0.199 -0.636 -0.346 -0.660
[3,]  0.884 -0.443  0.023  0.148
[4,]  0.122  0.099  0.814 -0.559
 > eigen(var(X))
$values
[1] 1.6723465 1.0434763 0.6966967 0.3397382

$vectors
            [,1]       [,2]        [,3]       [,4]
[1,] -0.4048158  0.6240510  0.46563382  0.4794473
[2,] -0.1994853  0.6361009 -0.34634256 -0.6600213
[3,]  0.8839775  0.4429553  0.02261302  0.1478618
[4,]  0.1221215 -0.0986234  0.81407655 -0.5591414


I would have expected the princomp component standard deviations to be 
the square roots of the eigen() $values and they clearly are not.

Murray Jorgensen

-- 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441    Mobile 021 1395 862



More information about the R-help mailing list