探索的因子分析の前提
1 2 3 4 5 6 7 | library(psych) # 欠損値はリストワイズで削除(もしくは use = "complete.obs" ) dat <- na.omit(dat) # Kaiser-Meyer-Olkin Measure of Sampling Adequacy KMO(dat[, -1]) # Bartlett's test cortest.bartlett(cor(dat[, -1]), n = nrow(dat)) |
因子数の決定
1 2 3 4 | # Very Simple Structure VSS(dat[, -1], n = nrow(dat), fm = "ml" ) # Parallel Analysis fa.parallel(cor(dat[, -1]), fm = "ml" , n.obs = nrow(dat), n.iter = 100) |
因子パタンの推定
1 2 3 4 5 6 7 8 9 10 | # 因子パタン RE.fa <- fa( dat, nfactors = 3, # 因子数を指定 fm = "ml" , # Maximum Likelihood (ml)・Weighted Least Squares (wls) rotate = "oblimin" # プロマックス回転はSPSSと同じ結果にならない ) print (RE.fa, sort = T, digits = 3) # 因子負荷量の可視化 fa.diagram(RE.fa, digits = 3) |