我正在尝试运行多级 SEM 并一直遵循此处使用的示例 ( https://lavaan.ugent.be/tutorial/multilevel.html ),但遇到了 [cluster=] 参数的问题。
具体来说,我不确定如何使用它/我应该放什么。在线,它说它应该是“数据框中的一个(单个)变量名称,定义了两级数据集中的集群。”。但是,我不确定如何从数据集中选择哪个变量放在那里。没关系吗?我尝试在没有 [cluster=] 的情况下运行模型,正如我在其他示例中看到的那样,但 R 不会让我这样做。(这是一个例子:https ://tutorials.methodsconsultants.com/posts/structural-equation-models-using-the-lavaan-package-in-r/ )
如果有帮助,这是我的代码:
model2h <- '
level: 1
gen=~IEES_04_HE_G + IEES_10_RI_G + IEES_12_RE_G + IEES_15_HE_G + IEES_18_RI_G +
IEES_24_HI_G + IEES_27_HI_G + IEES_32_RE_G
occ=~IEES_01_HI_O + IEES_06_HI_O + IEES_08_HE_O + IEES_14_RE_O + IEES_19_HE_O +
IEES_21_RI_O + IEES_28_RI_O + IEES_29_RE_O
hlt=~IEES_03_RI_H + IEES_05_HI_H + IEES_11_HI_H + IEES_16_RI_H + IEES_20_RE_H +
IEES_23_HE_H + IEES_26_RE_H + IEES_30_HE_H
soc=~IEES_02_RE_S + IEES_07_HE_S + IEES_09_HI_S + IEES_13_RI_S + IEES_17_HI_S +
IEES_22_HE_S + IEES_25_RE_S + IEES_31_RI_S
level: 2
internal=~IEES_01_HI_O + IEES_05_HI_H + IEES_06_HI_O + IEES_09_HI_S +
IEES_11_HI_H + IEES_17_HI_S + IEES_24_HI_G + IEES_27_HI_G + IEES_03_RI_H +
IEES_10_RI_G + IEES_13_RI_S + IEES_16_RI_H + IEES_18_RI_G + IEES_21_RI_O +
IEES_28_RI_O + IEES_31_RI_S
external=~IEES_04_HE_G + IEES_07_HE_S + IEES_08_HE_O + IEES_15_HE_G +
IEES_19_HE_O + IEES_22_HE_S + IEES_23_HE_H + IEES_30_HE_H + IEES_02_RE_S +
IEES_12_RE_G + IEES_14_RE_O + IEES_20_RE_H + IEES_25_RE_S + IEES_26_RE_H +
IEES_29_RE_O + IEES_32_RE_G'
fit2h <- sem(model = model2h, data = IEES, ordered = vars, cluster =???)
semPaths(fit2h, what = "paths", whatLabels = "par")