0

With prcomp() function, I have estimated percent variance explained

prcomp(env, scale=TRUE)

The second column of summary(pca) shows these values for all PCs:

                        PC1    PC2     PC3     PC4     PC5     PC6     PC7
Standard deviation     7.3712 5.8731 2.04668 1.42385 1.13276 0.79209 0.74043
Proportion of Variance 0.5488 0.3484 0.04231 0.02048 0.01296 0.00634 0.00554
Cumulative Proportion  0.5488 0.8972 0.93956 0.96004 0.97300 0.97933 0.98487

Now I want to find what the Eigenvalues for each PC are:

pca$sdev^2
[1] 5.433409e+01 3.449329e+01 4.188887e+00 2.027337e+00 1.283144e+00
[6] 6.274083e-01 5.482343e-01

But these values appear to be simply an alternate representation of the PVE itself. So what am I doing wrong here?

cryptic0
  • 225
  • 2
  • 12
  • You should share your data that gives this result. What do you mean by `an alternate representation of the PVE itself`? – Arun Feb 17 '13 at 20:59
  • Arun: 0.5488 *10 is roughly 5.433. From the publications I am looking at, Eigenvalues don't seem to have that kind of relationship with PVEs. – cryptic0 Feb 17 '13 at 21:01
  • does my answer clear the confusion? The variation (or variance) in each direction is given by each eigen value. And proportion of variance is just the ratio of each eigen value to the sum. Not sure what you're looking for if this doesn't help. – Arun Feb 17 '13 at 21:17
  • See also [pca-and-proportion-of-variance-explained](http://stats.stackexchange.com/questions/22569/pca-and-proportion-of-variance-explained) on stats.stackexchange. – denis Jan 02 '14 at 12:36

1 Answers1

5

I'm not sure if this is your confusion.

pca$sdev^2 -> eigen values -> variance in each direction
pca$sdev^2/sum(pca$sdev^2) = proportion of variance vector

So they ARE related.

Edit: Just an example (to illustrate this relationship), if that'll help.

set.seed(45) # for reproducibility
# set a matrix with each column sampled from a normal distribution
# with same mean but different variances
m <- matrix(c(rnorm(200,2, 10), rnorm(200,2,10), 
               rnorm(200,2,10), rnorm(200,2,10)), ncol=4)
pca <- prcomp(m)

> summary(pca) # note that the variances here equal that of input
# all columns are independent of each other, so each should explain
# equal amount of variance (which is the case here). all are ~ 25%
                           PC1     PC2     PC3    PC4
Standard deviation     10.9431 10.6003 10.1622 9.3200
Proportion of Variance  0.2836  0.2661  0.2446 0.2057
Cumulative Proportion   0.2836  0.5497  0.7943 1.0000

> pca$sdev^2
# [1] 119.75228 112.36574 103.27063  86.86322

> pca$sdev^2/sum(pca$sdev^2)
# [1] 0.2836039 0.2661107 0.2445712 0.2057142
Arun
  • 116,683
  • 26
  • 284
  • 387
  • I see. My confusion is mainly because I am looking a table in a publication (http://dx.doi.org/10.1111/mec.12043 Table 2). Here is the first line: PC 1 Eig 24.27 PVE 51.00 – cryptic0 Feb 17 '13 at 21:21
  • First, your first eigen vector is `54.33` **NOT** `5.433`. Second, so what if its `24.27` an `51.00%`? the 51% is `24.27/sum(...)`. Why does this concern you? – Arun Feb 17 '13 at 21:24
  • Maybe [this post](https://stat.ethz.ch/pipermail/r-help/2005-August/076610.html) in addition helps. I don't think there's anything to worry about. – Arun Feb 17 '13 at 21:32
  • Perhaps I should not be alarmed. I was startled because the numbers were looking similar. – cryptic0 Feb 17 '13 at 21:35
  • It would help if you just take a random matrix and calculate the eigen values the same way you do and check it to calm yourself! :) (I've edited the post to show this). – Arun Feb 17 '13 at 21:37