[R] Comparison of % variance explained by each PC before AND after rotation
Maurice McHugh
mmchug4 at lsu.edu
Tue Feb 17 15:38:50 CET 2004
Hello again-
Thanks to Prof. Ripley for responding to my previous question.
I would like to clarify my question using sample code. I will use some
sample code taken from ?prcomp
Again, I would like to compare the % variance explained by each PC
before and after rotation.
< code follows >
data(USArrests)
pca = prcomp(USArrests, scale = TRUE)
# proportion variance explained by each PC
prop = pca$sdev^2/sum(pca$sdev^2)
# cumulative proportion variance explained by each PC
cumProp = cumsum(prop)
# following print statements also can be obtained
# from print(summary(pca))
#print(prop)
#print(cumProp)
print(summary(pca))
# Rotate the PCA loadings through PCs 1 and 2 using VARIMAX rotation
rot = varimax(pca$rotation[,1:2], normalize = TRUE, eps = 1e-5)
< end code >
How can I calculate the new % variance explained by each PC after
rotation ??????
Many thanks once more,
--
Maurice J. McHugh, Ph.D.
Assistant Professor
Department of Geography and Anthropology
227 Howe Russell Geoscience Complex
Louisiana State University Phone: (225)578-0476
Baton Rouge, LA Fax: (225)578-4420
USA
More information about the R-help
mailing list