0

我用 进行因子分析fa,我获得了 8 个因子(我将只使用其中的 5 个,SS Loading >1 的那些),现在我想为我的原始数据集的每一行(我的调查的受访者)分配每个因素的得分。

分数存储在哪里?如何创建五个新列并为每个列分配因子分数?

CorrMatrix 是项目的相关矩阵(30x30 矩阵)

fa.varimax<-fa(CorrMatrix,nfactors = 8,rotate = "varimax",fm="pa")

原始数据集包含 2994 名受访者,每行一名受访者

item1 item2 item3 ... item30 1 3 5 ... 4 3 4 2 ... 5

我想做的是在原始数据集的末尾添加五个新列

factor1 factor2 factor3 factor4 factor5
score1i score2i score3i score4i score5i
score1j score2j score3j score4j score5j

对于所有 2994 名受访者

4

1 回答 1

1

假设您正在使用该psych库,因为问题没有说明。SS 载荷不直接存储在因子分析中,但可以计算。

library(psych)

fa.loadings <- colSums(fa.varimax$loadings ^ 2)  # calculate factor loading
fa.loadings <- fa.loadings[fa.loadings > 1]  # filter factor loading

参考:https ://web.stanford.edu/class/psych253/tutorials/FactorAnalysis.html

于 2017-03-08T21:43:33.787 回答