Detailed data attached at the end
Detailed code see github.com

Factor analysis using psych package: A brief example

For more details of Parallel Analysis, see Factor Retention Decisions in Exploratory Factor Analysis: A Tutorial on Parallel Analysis

判断公共因子个数的方法:

当摇摆不定时, 高估因子比低估好, 因为高估因子较少曲解“真实”情况

library(psych)
fa.parallel(mydata, fa = "fa", n.iter = 100, 
            show.legend = FALSE, main = "Scree plot with parallel analysis")

## Parallel analysis suggests that the number of factors =  4  and the number of components =  NA

按照parallel analysis的结果, 选取四个因子

fa0=factanal(~., factors=4, data=mydata, rotation="none")   ##不旋转因子难以解释
print(fa0)
## 
## Call:
## factanal(x = ~., factors = 4, data = mydata, rotation = "none")
## 
## Uniquenesses:
##    FL   APP    AA    LA    SC    LC   HON   SMS   EXP   DRV   AMB   GSP 
## 0.443 0.685 0.521 0.185 0.119 0.198 0.339 0.138 0.357 0.226 0.137 0.153 
##   POT    KJ  SUIT 
## 0.090 0.005 0.252 
## 
## Loadings:
##      Factor1 Factor2 Factor3 Factor4
## FL    0.473           0.549  -0.177 
## APP   0.334   0.426           0.140 
## AA   -0.272   0.475   0.336   0.258 
## LA    0.700           0.124   0.555 
## SC    0.552   0.641  -0.396         
## LC    0.600   0.649  -0.134         
## HON   0.465          -0.273   0.603 
## SMS   0.634   0.643          -0.205 
## EXP   0.237   0.189   0.717  -0.192 
## DRV   0.673   0.538          -0.155 
## AMB   0.618   0.652  -0.137  -0.191 
## GSP   0.625   0.664           0.115 
## POT   0.617   0.671   0.178   0.220 
## KJ    0.992  -0.105                 
## SUIT  0.440   0.372   0.621  -0.175 
## 
##                Factor1 Factor2 Factor3 Factor4
## SS loadings      5.023   3.452   1.647   1.033
## Proportion Var   0.335   0.230   0.110   0.069
## Cumulative Var   0.335   0.565   0.675   0.744
## 
## Test of the hypothesis that 4 factors are sufficient.
## The chi square statistic is 84 on 51 degrees of freedom.
## The p-value is 0.00247
fa1=factanal(~., factors=4, data=mydata, scores="Bartlett")  ##默认旋转
print(fa1)
## 
## Call:
## factanal(x = ~., factors = 4, data = mydata, scores = "Bartlett")
## 
## Uniquenesses:
##    FL   APP    AA    LA    SC    LC   HON   SMS   EXP   DRV   AMB   GSP 
## 0.443 0.685 0.521 0.185 0.119 0.198 0.339 0.138 0.357 0.226 0.137 0.153 
##   POT    KJ  SUIT 
## 0.090 0.005 0.252 
## 
## Loadings:
##      Factor1 Factor2 Factor3 Factor4
## FL    0.129   0.717   0.113  -0.117 
## APP   0.458   0.142   0.243   0.164 
## AA            0.126           0.677 
## LA    0.231   0.239   0.838         
## SC    0.918           0.142         
## LC    0.838   0.111   0.291         
## HON   0.252  -0.216   0.742         
## SMS   0.885   0.258                 
## EXP           0.778           0.165 
## DRV   0.767   0.389   0.172         
## AMB   0.904   0.181                 
## GSP   0.792   0.275   0.351   0.148 
## POT   0.735   0.349   0.432   0.247 
## KJ    0.424   0.389   0.554  -0.598 
## SUIT  0.364   0.770           0.142 
## 
##                Factor1 Factor2 Factor3 Factor4
## SS loadings      5.570   2.473   2.099   1.013
## Proportion Var   0.371   0.165   0.140   0.068
## Cumulative Var   0.371   0.536   0.676   0.744
## 
## Test of the hypothesis that 4 factors are sufficient.
## The chi square statistic is 84 on 51 degrees of freedom.
## The p-value is 0.00247

结果显示因子变得更好解释了:

apply(fa1$scores,2,which.max)  ## 各因子得分最高者
## Factor1 Factor2 Factor3 Factor4 
##      10      42      46      46
apply(fa1$scores,2,which.min)  ## 各因子得分最低者
## Factor1 Factor2 Factor3 Factor4 
##      42      47      42      29
plot(fa1$scores[, 1:2], type="n", main="前两个公共因子得分图")
text(fa1$scores[,1], fa1$scores[,2])

Appendix: datasets

applicant
X FL APP AA LA SC LC HON SMS EXP DRV AMB GSP POT KJ SUIT
1 6 7 2 5 8 7 8 8 3 8 9 7 5 7 10
2 9 10 5 8 10 9 9 10 5 9 9 8 8 8 10
3 7 8 3 6 9 8 9 7 4 9 9 8 6 8 10
4 5 6 8 5 6 5 9 2 8 4 5 8 7 6 5
5 6 8 8 8 4 4 9 5 8 5 5 8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