因子分析 - 按行分配分数

Factor Analysis - Assigning scores by row

我运行一个fa的因子分析,我得到了8个因子(我将只使用其中的5个,SS加载> 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 名受访者

假设您正在使用 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