I am looking at this link http://strata.uga.edu/8370/lecturenotes/principalComponents.html where it says
In interpreting the principal components, it is often useful to know the correlations of the original variables with the principal components. The correlation of variable $X_i$ and principal component $Y_j$ is
$$ r_{ij} = \sqrt{a_{ij}^2\times \mathrm{var}(Y_j)/s_{ii}}$$
where $a_{ij}$ is the $i$-th's variable principal component weight on on principal component $j$ and $Y_j$ is the $j$-th principal component score and I am not sure what $s_{ii}$ is.
I do a simple PCA on the iris dataset below and would like to calculate the correlation of sepal width and legth to PC score 1 and PC score 2 but what is $s_{ii}$?
The $\mathrm{var}(Y_j)$ is the variance of the principal component score. I have that in the VarofSCores
object below. In that link the author says $S_Y$ is the varcov matrix of the scores so if $s_{ii}$ is the diagonal of $S_Y$ then that is the same value I have in VarOfSCores
.
data(iris)
names(iris)
dat = data.frame(iris$Sepal.Width, iris$Sepal.Length)
pca= prcomp(dat)
PC = pca$rotation
VarOfScores = pca$sd^2
scores = pca$x
#correlation of sepal width to score 1
sqrt(PC[1,1]^2* VarOfScores[1]/?? )
#correlation of sepal width to score 2
sqrt(PC[1,2]^2* VarOfScores[2]/?? )
#correlation of sepal LENGTH to score 1
sqrt(PC[2,1]^2* VarOfScores[1]/?? )
#correlation of sepal LENGTH to score 2
sqrt(PC[2,2]^2* VarOfScores[2]/?? )
Also - Why does the author say "loadings" instead of "principal components". The eigenvectors are "principal components" not "loadings" and the data times the eigenvectors are "scores". I think that is poor terminology. See here http://www.cs.princeton.edu/courses/archive/spr08/cos424/scribe_notes/0424.pdf where the author states on on page 4 "V" is the principal components.