Skip to content

weird results w/ prcomp-princomp

3 messages · Alessandro Bigi, Jari Oksanen, ronggui

#
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.
#
On Fri, 2005-04-08 at 11:12 +0200, Alessandro Bigi wrote:
What about the sum of squared sdev? (Hint, the "prcomp" help page says
that the returned sdev are the square root of the eigenvalues. While
"princomp" help does not say this explicitly, it says that "sdev" are
standard deviations).

cheers, jari oksanen
#
R2.0.1
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.
[1] 19

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