[R] R and S-Plus got the different results of principal component analysis from SAS, why?

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Tue Jan 30 15:47:26 CET 2007


zhijie zhang wrote:
> Dear Rusers,
>
>   I have met a difficult problem on explaining the differences of principal
> component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't
> met before.
>
>   Althought they have got the same eigenvalues, their coeffiecients were
> different.
>
>   First, I list my results from R,S-PLUS and SAS/STATA/SPSS, and then show
> the original dataset, hoping sb. to try and explain it.
>
>   SAS,STATA,and SPSS have the same results, so i put them together. From
> their results, we see that the absolute values of coeffiecient are same, but
> PC1,PC2,PC4,PC5 and PC6 in R have the opposite sign on the coeffiecnts
> contrast with SAS, and PC4,PC5 in S-PLUS have the opposite sign on the
> coeffiecnts contrast with SAS. Curiously, I got the same results amont all
> these software using my another dataset.
>
> *
Principal components are only *defined* up to sign changes (as the help
page for prcomp says quite explicitly!!!!)

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list