1

lavaanR多重插补后,我正在运行一些多组验证性因素分析 (CFA) 。

首先,我创建了一个名为Plav存储 5 个估算数据集的列表:

library(lavaan)
library(lavaan.survey)
library(mitools)
library(semTools)

a <- imputationList(Plav) ##Tell R these are plausible values
Survey <- svydesign(ids = ~1, weights = ~wt, data = a) # set the weight

随后,我进行了多组CFA:

# Model without population corrections
fit <- cfa(model, data=Plav[[1]], estimator = 'MLR', missing = 'default', group = 'gender',group.equal = c("loadings"))
# Model with population corrections
fitSurvey <- lavaan.survey(lavaan.fit = fit, survey.design =  Survey)

返回以下错误:

Error in FUN(X[[1L]], ...) : 
  dims [product 1936] do not match the length of object [0]

当我删除分组变量并对整个样本进行分析时,不会返回任何错误。

谁能解释为什么会返回此错误?

4

0 回答 0