Skip to content
Prev 281106 / 398506 Next

Help with PCA

Sarah and elisacarli21

principal in the psych package will do principal components of a correlation or covariance matrix.

ex:

library(psych)
principal(Thurstone,3,rotate="none")   #First three principal components of the Thurstone correlation matrix
#compare with eigen
e <- eigen(Thurstone)   #perform an eigen value decomposition
e   #show the resuls
e$vectors %*% diag(sqrt(e$values))  #convert to "loadings" and compare with the output from principal



Bill
On Dec 28, 2011, at 9:09 AM, Sarah Goslee wrote:

            
William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 6 minutes to midnight	   http://www.thebulletin.org