[R] princomp() output loadings component missing

Ben Tupper btupper at bigelow.org
Sun Jan 29 22:12:59 CET 2017


Hi,

Check out the detailed explanation in the 'Value' section of ?princomp - in particular for 'loadings'.  It will send you to ?loadings where it explains why that one element appears to be missing.

If you really want to see the missing value try...

p3$loadings['Rape', 'Comp.4']

... or even ...

unclass(p3$loadings)

Don't forget that this email list works best when messages are send in plain text, and it works poorly for html or rich text.  Check the settings in your email client.  In case others are interested here is what the loadings print to...

Loadings:
         Comp.1 Comp.2 Comp.3 Comp.4
Murder   -0.536  0.418 -0.341  0.649
Assault  -0.583  0.188 -0.268 -0.743
UrbanPop -0.278 -0.873 -0.378  0.134
Rape     -0.543 -0.167  0.818       

               Comp.1 Comp.2 Comp.3 Comp.4
SS loadings      1.00   1.00   1.00   1.00
Proportion Var   0.25   0.25   0.25   0.25
Cumulative Var   0.25   0.50   0.75   1.00 

Cheers,
Ben

> On Jan 29, 2017, at 4:31 AM, Fix Ace via R-help <r-help at r-project.org> wrote:
> 
> Hello, there,
> I did a test run for this princomp() function using USArrests data. The R document says that the output loadings contain the eigenvector matrix. When I looked at this matrix, I found that a missing item for Comp.4 
> 
>> p3=princomp(USArrests, cor=TRUE )> p3$loadings
> Loadings:         Comp.1 Comp.2 Comp.3 Comp.4Murder   -0.536  0.418 -0.341  0.649Assault  -0.583  0.188 -0.268 -0.743UrbanPop -0.278 -0.873 -0.378  0.134Rape     -0.543 -0.167  0.818       
>                Comp.1 Comp.2 Comp.3 Comp.4SS loadings      1.00   1.00   1.00   1.00Proportion Var   0.25   0.25   0.25   0.25Cumulative Var   0.25   0.50   0.75   1.00
> How should I explain this?
> Thanks.
> Ace
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org



More information about the R-help mailing list