Measurement Invariance

8 views
Skip to first unread message

Tomás Arriaza

unread,
Jul 2, 2024, 10:27:15 PM (10 hours ago) Jul 2
to lavaan
I don't know what I am doing wrong. I am trying to test for measurement invariance for first time with lavaan, but I get two warnings that are worrying me.

I would really appreciate any feedback of my script. I want to be able to replicate Mplus analysis (where I didn't have problems) or at least explain differences in specifications.

Thank you very much in advance!

My results:

Scaled Chi-Squared Difference Test (method = “satorra.2000”) lavaan NOTE: The “Chisq” column contains standard test statistics, not the robust test that should be reported per model. A robust difference test is a function of two standard (not robust) statistics. Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq) model1.metric 1154 4168.1 model1.configural 1295 4036.1 -92.527 141 1 model1.scalar 1295 4036.1 0.000 0 Warning messages: 1: In lavTestLRT(model1.configural, model1.metric, model1.scalar, scaled.shifted = TRUE) : lavaan WARNING: Some restricted models fit better than less restricted models; either these models are not nested, or the less restricted model failed to reach a global optimum. Smallest difference = -132.008261570369 2: In lavTestLRT(model1.configural, model1.metric, model1.scalar, scaled.shifted = TRUE) : lavaan WARNING: some models have the same degrees of freedom

My script:

syntax <- "
Part1 =~ ics1_1 + ics1_2 + ics1_3 + ics1_4 + ics1_5
Part2 =~ ics2_1 + ics2_2 + ics2_3 + ics2_4_r + ics2_5 + ics2_6_r + ics2_7_r + ics2_8 + ics2_9 + ics2_10_r
Part3 =~ ics3_1 + ics3_2 + ics3_3 + ics3_4_r + ics3_5 +  ics3_6_r + ics3_7_r + ics3_8 + ics3_9 + ics3_10_r
"

model1.configural <- cfa(syntax,
              data = db2,
              ordered = c("ics1_1","ics1_2","ics1_3","ics1_4","ics1_5",
                          "ics2_1","ics2_2","ics2_3","ics2_4_r","ics2_5",
                          "ics2_6_r","ics2_7_r","ics2_8","ics2_9","ics2_10_r",
                          "ics3_1","ics3_2","ics3_3","ics3_4_r","ics3_5",
                          "ics3_6_r","ics3_7_r","ics3_8","ics3_9","ics3_10_r"),
              estimator = "WLSMV", missing = "pairwise",mimic = "Mplus",
              group = "consumo")

model1.metric <- cfa(syntax,
                     data = db2,
                     ordered = c("ics1_1","ics1_2","ics1_3","ics1_4","ics1_5",
                                 "ics2_1","ics2_2","ics2_3","ics2_4_r","ics2_5",
                                 "ics2_6_r","ics2_7_r","ics2_8","ics2_9","ics2_10_r",
                                 "ics3_1","ics3_2","ics3_3","ics3_4_r","ics3_5",
                                 "ics3_6_r","ics3_7_r","ics3_8","ics3_9","ics3_10_r"),
                     estimator = "WLSMV", missing = "pairwise",mimic = "Mplus",
                     group = "consumo", group.equal = c("loadings"))

model1.scalar <- cfa(syntax,
                     data = db2,
                     ordered = c("ics1_1","ics1_2","ics1_3","ics1_4","ics1_5",
                                 "ics2_1","ics2_2","ics2_3","ics2_4_r","ics2_5",
                                 "ics2_6_r","ics2_7_r","ics2_8","ics2_9","ics2_10_r",
                                 "ics3_1","ics3_2","ics3_3","ics3_4_r","ics3_5",
                                 "ics3_6_r","ics3_7_r","ics3_8","ics3_9","ics3_10_r"),
                     estimator = "WLSMV", missing = "pairwise",mimic = "Mplus",
                     group = "consumo", group.equal = c("loadings", "thresholds"))

model1.strict  <- cfa(syntax,
                     data = db2,
                     ordered = c("ics1_1","ics1_2","ics1_3","ics1_4","ics1_5",
                                 "ics2_1","ics2_2","ics2_3","ics2_4_r","ics2_5",
                                 "ics2_6_r","ics2_7_r","ics2_8","ics2_9","ics2_10_r",
                                 "ics3_1","ics3_2","ics3_3","ics3_4_r","ics3_5",
                                 "ics3_6_r","ics3_7_r","ics3_8","ics3_9","ics3_10_r"),
                     estimator = "WLSMV", missing = "pairwise",mimic = "Mplus",
                     group = "consumo", group.equal = c("loadings", "thresholds","residuals"))

lavTestLRT(model1.configural,model1.metric,model1.scalar,
           scaled.shifted = TRUE)

Jošt Bartol

unread,
3:44 AM (5 hours ago) 3:44 AM
to lav...@googlegroups.com
Hi, Tomas,

Perhaps lavaan does not understand what you mean by "thresholds". See here https://lavaan.ugent.be/tutorial/groups.html, and maybe try "intercepts" instead.

Best,
Jošt

V V sre., 3. jul. 2024 ob 04:27 je oseba Tomás Arriaza <tom.a...@gmail.com> napisala:
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/c559650e-640a-4a95-bdd2-ac9715dc55c7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages