运行 sem() 函数时遇到以下错误:
我刚刚使用不同的语法运行了这段代码,它工作了;所以我知道问题应该是我将因素加载到语法的方式......还是错字?
library(psych)
library(sem)
#Creating syntax equation
mgb_syn_eq <- "
MIL: S.Defense #Military and National Security
GOV: E.GovLess, E.GovFM, E.GovBig #Limited Government
BUS: E.BusinessReg #Business
"
#Creating CFA Syntax from theory
mgb_syn <- cfa(text = mgb_syn_eq, reference.indicators = FALSE)
#Use the sem() function to run a CFA
mgb_CFA <- sem(mgb_syn, data = df.secs_CFA)
w_mat % % p_deriv_mat % % invMat 中的错误:需要数字/复数矩阵/向量参数