[R] prcomp: results with reversed sign in output?
murdoch.duncan at gmail.com
Fri Sep 9 11:53:10 CEST 2011
On 11-09-09 5:42 AM, René Mayer wrote:
> thanks for pointing out Paul,
> but the thing which is annoying me in the first place IS this
> direction reversal.
> this makes no sense for me
> why could this be?
I think you need to read more about principal components. The signs
within a PC vector are meaningful only relative to each other (e.g. most
of the variation in the variables is in the same direction: as
standardized murder rates increase, the others increase by approximately
the same amount), but switching all of the signs within a vector gives
the same meaning (e.g. as murder decreases, all of the others decrease).
> Zitat von "Paul Hiemstra"<paul.hiemstra at knmi.nl>:
>> If all the signs are switched the PC's are still the same. The principal
>> vectors are along the same axis, only in a different direction. So there
>> is no problem :).
>> hope this helps,
>> On 09/09/2011 09:01 AM, René Mayer wrote:
>>> Dear All,
>>> when I'm running a PCA with
>>> prcomp(USArrests, scale = TRUE)
>>> I get the right principal components, but with the wrong sign infront
>>> PC1 PC2 PC3 PC4
>>> Murder 0.5358995 -0.4181809 0.3412327 0.64922780
>>> Assault 0.5831836 -0.1879856 0.2681484 -0.74340748
>>> UrbanPop 0.2781909 0.8728062 0.3780158 0.13387773
>>> Rape 0.5434321 0.1673186 -0.8177779 0.08902432
>>> instead of
>>> PC1 PC2 PC3 PC4
>>> Murder -0.5358995 0.4181809 -0.3412327 0.64922780
>>> Assault -0.5831836 0.1879856 -0.2681484 -0.74340748
>>> UrbanPop -0.2781909 -0.8728062 -0.3780158 0.13387773
>>> Rape -0.5434321 -0.1673186 0.8177779 0.08902432
>>> what is happening here?
>>> any ideas?
>>> R-help at r-project.org mailing list
>>> PLEASE do read the posting guide
>>> and provide commented, minimal, self-contained, reproducible code.
>> Paul Hiemstra, Ph.D.
>> Global Climate Division
>> Royal Netherlands Meteorological Institute (KNMI)
>> Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39
>> P.O. Box 201 | 3730 AE | De Bilt
>> tel: +31 30 2206 494
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help