library(lavaan)
data(cfa_two_factors)
mod <-
"
f1 =~ x1 + x2 + x3
f2 =~ x4 + x5 + x6
"
fit <- sem(mod, cfa_two_factors)
# Should be 0
check_sem_out(fit)
fit2 <- sem(mod, cfa_two_factors, estimator = "DWLS")
# Should be negative because DWLS is officially not supported
check_sem_out(fit2)
fit3 <- sem(mod, cfa_two_factors, estimator = "MLR")
# Should be negative because MLR is supported only if
# robust is set to "satorra.2000"
check_sem_out(fit3)
# Should be zero because robust is set to "satorra.2000"
check_sem_out(fit3, robust = "satorra.2000")
Run the code above in your browser using DataLab