# Re: [R] How to read "Cumulative proportion" in using princomp?

From: Martyn Byng <Martyn.Byng_at_nag.co.uk>
Date: Wed, 16 Mar 2011 17:31:57 +0000

Hi,

The values are calculated on the fly in the summary function

stats:::print.summary.princomp

using

vars <- result\$sdev^2
vars <- vars/sum(vars)
cumsum(vars)

Martyn

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of ian_zhangty
Sent: 16 March 2011 14:19
To: r-help_at_r-project.org
Subject: [R] How to read "Cumulative proportion" in using princomp?

Dear all,

> result<-summary(princomp(x,cor=TRUE))
>result
Importance of components:

```                         Comp.1    Comp.2     Comp.3     Comp.4
Standard deviation     1.642136 1.0114376 0.45146892 0.27669119
```
Proportion of Variance 0.674153 0.2557515 0.05095605 0.01913950 Cumulative Proportion 0.674153 0.9299044 0.98086050 1.00000000

I want to read Cumlative Proportion listed above. But I cannot find it in
result, instead, R gives me followed, which is not same with above:
>result[2]

```        Comp.1 Comp.2 Comp.3 Comp.4
YC.T     0.183  0.935  0.250  0.172
YC.Rain -0.537  0.308 -0.784
```

YC.ETPM 0.583 0.119 -0.389 -0.703
```               Comp.1 Comp.2 Comp.3 Comp.4
```
Proportion Var 0.25 0.25 0.25 0.25 Cumulative Var 0.25 0.50 0.75 1.00

I am wondering how can I calculate "Cumulative Proportion" in the first result.
Thank you very much

```--
View this message in context:
-princomp-tp3381881p3381881.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.\ _...{{dropped:12}}

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help