[R] weird results w/ prcomp-princomp

ronggui 0034058 at fudan.edu.cn
Fri Apr 8 18:00:26 CEST 2005


R2.0.1
> x<-matrix(rnorm(44*19),nrow=44)
> princomp(x,cor=TRUE,scores=TRUE)
Call:
princomp(x = x, cor = TRUE, scores = TRUE)

Standard deviations:
   Comp.1    Comp.2    Comp.3    Comp.4    Comp.5    Comp.6    Comp.7    Comp.8
1.5874672 1.4652217 1.3088833 1.2339949 1.1697727 1.1402570 1.0774402 1.0458567
   Comp.9   Comp.10   Comp.11   Comp.12   Comp.13   Comp.14   Comp.15   Comp.16
1.0152164 0.9403912 0.8854087 0.8433314 0.7918201 0.7454395 0.6680463 0.6240805
  Comp.17   Comp.18   Comp.19
0.5752994 0.4873633 0.4205193

 19  variables and  44 observations.
> sum(princomp(x,cor=TRUE,scores=TRUE)$sdev^2)
[1] 19

it seems ok. 
On Fri, 08 Apr 2005 11:12:26 +0200
Alessandro Bigi <abigi at agrsci.unibo.it> wrote:

> I am doing a Principal Component Analaysis (PCA) on a 44x19 matrix.
> with
>  > princomp(x,cor=TRUE,scores=TRUE)
> and
>  > prcomp(x,scale=TRUE,center=TRUE)
> The resulted eigenv. and rotated matrix are the same (as expected), however 
> the sum of eigenvalues is lower than 19 (number of variables).
> 
> With a commercial stat software it worked correctly, with the same dataset.
> Am I doing something wrong?
> Thanks
> Alex
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> 
> 
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list