On Sun, 13 Jan 2008, Xingwang Ye wrote: > Dear R users, > When I tried to use princomp() from stats packages to do Principal > Components Analysis, I am not very clear what is the "scale". > And the scores are different from "PROC PRINCOMP" procedure from SAS. > > Using the example data from this package: > > restpc <- princomp(USArrests, cor = TRUE) > > restpc$scale > Murder Assault UrbanPop Rape > 4.311735 82.500075 14.329285 9.272248 > > sd(USArrests) > Murder Assault UrbanPop Rape > 4.355510 83.337661 14.474763 9.366385 > > Why 'restpc$scale' is different from 'sd(USArrests)'?
Please do read the help before posting, as the posting guide asks. It says Note that the default calculation uses divisor 'N' for the covariance matrix. And please note that unlike SAS, you can read the code to ascertain the precise computations done. > felix > > ______________________________________________ > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@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.