Created
September 18, 2014 06:47
-
-
Save njtierney/77fa7d5f35251dbba96c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# turn the data into a correlation matrix | |
cor(mydata) | |
# perform the PCA, using `principal` | |
pca.fit <- principal(mydata, | |
nfactors = ncol(mydata), # the number of factors = the number of columns in my data | |
rotate = "varimax", # I want to perform varimax rotation on the factors | |
residuals = TRUE, # report the residuals | |
scores = TRUE) # find the component scores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment