主成分分析:是一种数据降维技巧。
princomp
install.packages("psych")
library(psych)
USJudgeRatings
class(USJudgeRatings)
fa.parallel(USJudgeRatings,fa="pc",n.iter=100) 碎石图:1
pc<-principal(USJudgeRatings,nfactors=3,rotate="none",scores=FALSE)
fa.parallel(Harman23.cor$cov,n.obs=302,fa="pc",n.iter=100,show.legend=FALSE)碎石图:2
pc<-principal(Harman23.cor$cov,nfactors=2,rotate="none")
fa.parallel(x,fa="pc",n.iter=100)
pc<-principal(x,nfactors=3,rotate="none",scores=FALSE)