[英]Factor in R according to factor analysis
我有兴趣从 4 个变量中创建一个因子,这些变量被建议为我的因子分析中的一个因子。 现在我正试图准确地创建这个因子以输入我的分析,但是 as.factor(x) 没有结合我的虚拟变量。
我们可以使用interaction
with(df1, interaction(col1, col2, col3, col4, drop = TRUE))
您是否希望将多个变量组织成一个因素,然后可以对其进行验证性因素分析? 如果是这样,以下示例显示如何指定要加载到所述因子的数据集中的哪些项目。 Specifying the factor loadings requires the psych
package in R and creating the factor model requires the sem()
function from the sem package.
theoretical_factor_structure <- "
AGREEABLE: A1, A2, A3, A4, A5"
factors_for_CFA <- cfa(text = theoretical_factor_structure,
reference.indicators = FALSE)
CFA_model <- sem(factors_for_CFA, data = CFA_data_split)
抱歉,如果这不是您要问的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.