[R] prcomp compared to SPAD

ben@zoo.ufl.edu ben at zoo.ufl.edu
Tue Oct 3 15:29:55 CEST 2000


  I am pretty ignorant but: 

   scale: a logical value indicating whether the variables should be
          scaled to have unit variance before the analysis takes place.
          The default is `FALSE' for consistency with S, but in general
          scaling is advisable. Alternately, a vector of length equal
          the number of columns of `x' can be supplied.  The value is
          passed to `scale'.


If you use scale=TRUE you at least get agreement in the proportion of
variance/cumulative proportion columns.

On Tue, 3 Oct 2000, Christine Serres wrote:

> Hi !
> 
> I've used the example given in the documentation for the prcomp function
> both in R and SPAD to compare the results obtained.
> Surprisingly, I do not obtain the same results for the coordinates of
> the principal composantes with these two softwares.
> 
> 
> using USArrests data  I obtain with R :
> 
> > summary(prcomp(USArrests))
> Importance of components:
>                           PC1     PC2    PC3     PC4
> Standard deviation     83.732 14.2124 6.4894 2.48279
> Proportion of Variance  0.966  0.0278 0.0058 0.00085
> Cumulative Proportion   0.966  0.9933 0.9991 1.00000
> 
> 
> And using SPAD (french editor CISIA) :
> 
> Ex:           sd        pv        cp
> comp1   |   2.4802   |   62.01  |   62.01  |
> comp2   |   0.9898   |   24.74  |   86.75  |
> comp3   |   0.3566   |    8.91  |   95.66  |
> comp4   |   0.1734   |    4.34  |  100.00  |
> 
> 
> Am I wrong using R  ? Why the results are so different ?
> Furthemore could anyone explain me the difference between prcomp and
> princomp, since we do not obtain exxactly the same results using these
> two functions.
> And how to obtain the coordinates of the points on the first composante
> using R ?
> 
> Many thanks,
> Christine
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list