The column sums of the cos2 matrix are the variances of PCs. all.equal(X.prcomp.var$cos2,X.prcomp.var$coord^2) If we square the loading matrix, we get the quality of representation for variables on the factor map (the cos2 output from get_pca_var function). The row sum of squares of the loadings are 1s. The column sum of squares of the loadings are the variances of PCs. X.prcomp$rotation %*% diag(X.prcomp$sdev) X.princomp$loadings %*% diag(X.princomp$sdev) # use get_pca_var from factoextra package They are also covariances/correlations between the original variables and the unit-scaled components. eigenvectors endowed by corresponding component variances, or eigenvalues. Loadings are unstandardized eigenvectors’ elements, i.e. These are the coordinates of the features/variables on the principal components. # look at variables that contribute to principal component 1 X.princomp$loadings # Strictly speaking, they are not the real 'loadings'. It is a $n*p$ matrix with $n$ individuals/observations as rows and $p$ features/variables as columns.įirstly, center (necessary) and scale (not required, depending on the data structure) X, so that the column means are 0s, and the column variances are 1s. Principal Components Analysis Hong Zheng /ĭenote the data matrix as $X$. Principal Components Analysis - LittleBitofData