Three groups path analyses with Lavaan and group="Condition"

219 views
Skip to first unread message

Olaya Moldes

unread,
Oct 1, 2019, 6:46:59 AM10/1/19
to lavaan
Hello!

I have a data set of an experimental survey with 3 conditions (manipulation 1, manipulation 2 & control). I want to test a mediation model using path analysis and compare the mediation on the three groups on a model with 2IVs, 2 Mediators and 2 DVs. First, I have fitted a direct model (2 IVs predicting 2 DVs + covariances between the two IVs and the two DVs) and use the command group="Condition". The results obtained in R look like this:

lavaan 0.6-4 ended normally after 66 iterations

  Optimization method                           NLMINB
  Number of free parameters                         42
  Number of equality constraints                     2
  Row rank of the constraints matrix                 2

  Number of observations per group         
  2                                                102 <-- Condition 2
  1                                                 97 <-- Condition 1
  0                                                109 <-- Control Condition

  Estimator                                         ML
  Model Fit Test Statistic                       3.515
  Degrees of freedom                                 2
  P-value (Chi-square)                           0.172

Chi-square for each group:

  2                                              3.515
  1                                              0.000
  0                                              0.000

Model test baseline model:

  Minimum Function Test Statistic               86.690
  Degrees of freedom                                18
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.978
  Tucker-Lewis Index (TLI)                       0.801

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1925.258
  Loglikelihood unrestricted model (H1)      -1923.500

  Number of free parameters                         40
  Akaike (AIC)                                3930.516
  Bayesian (BIC)                              4079.720
  Sample-size adjusted Bayesian (BIC)         3952.857

Root Mean Square Error of Approximation:

  RMSEA                                          0.086
  90 Percent Confidence Interval          0.000  0.231
  P-value RMSEA <= 0.05                          0.249

Standardized Root Mean Square Residual:

  SRMR                                           0.020

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard


Group 1 [2]:

Regressions: 

[...]

Group 2 [1]

Regressions: 

[...]

Group 3 [0]

Regressions: 

[...]

I am assuming that the multigroup command is fitting the model to each group independently, right? Should I be using a different command to fit the model independently to each group or subset of the data?

I am able to compare if the models are significantly different from each other as I would do with a two group model? What does the p value highlighted is indicating? Differences between the three groups or differences between the two conditions (indicated as 1 and 2 in the Condition variable) and the Control condition (marked as 0 in the Condition variable)?

Why do I only get a chi-square for group 2? Should I do two comparison using a dummy variable each time (i.e., 1 = conditions vs 0 = control and then, condition 1 = 1 vs condition 2 = 0 on a subset without the control group scores)?

Thank you :)!

Edward Rigdon

unread,
Oct 1, 2019, 7:38:03 AM10/1/19
to lav...@googlegroups.com
Olaya--
     Your syntax would be better than your results as a guide to what analysis was conducted, though there are clues.
     You *did* get chi-squares for all three groups, but chi-square was 0 for 2 of the groups. If this is real data, then random sampling error would keep chi-square from being exactly 0 unless the model is saturated (degrees of freedom or DF = 0). Therefore, the model you actually estimated was saturated in 2 groups but had 2 effective constraints in one group.
     In addition, if the model were the same in all 3 groups but estimated separately in each group, then degrees of freedom would have to be a multiple of 3--DF in a single group times 3 groups. With 2 DF total, this cannot be so.
     Therefore, your syntax produced a model with 2 constraints in 1 group and saturation in the others. The model that you describe--2 predictors with direct effects on 2 outcome variables, with residual covariance between predictors and between outcomes--sounds saturated to me, so DF should be 0. So it seems most likely that there is an error in your syntax involving the first group. With that error resolved, however, chi-square will be 0 for all 3 groups, because the model will be saturated in all 3 groups.
--Ed Rigdon

--
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/42937d34-e54d-4b36-bc83-11bad3f873dc%40googlegroups.com.

Olaya Moldes

unread,
Oct 1, 2019, 8:40:35 AM10/1/19
to lavaan
Thank you for your answer Ed, it does make a lot of sense. I corrected my syntax for the direct models based on this post an is now looking like this:

model0<- '
Y1 ~ c(c1, c2, c3)*X1 + c(c4, c5, c6)*X2
Y2 ~ c(c7, c8, c9)*X1 + c(c10, c11, c12)*X2
X1 ~~ X2
Y1 ~~ Y2
'

And get the following results:

lavaan 0.6-4 ended normally after 77 iterations

  Optimization method                           NLMINB
  Number of free parameters                         42

  Number of observations per group         
  2                                                102
  1                                                 97
  0                                                109

  Estimator                                         ML
  Model Fit Test Statistic                       0.000
  Degrees of freedom                                 0
  Minimum Function Value               0.0000000000000

Chi-square for each group:

  2                                              0.000
  1                                              0.000
  0                                              0.000

Model test baseline model:

  Minimum Function Test Statistic               86.690
  Degrees of freedom                                18
  P-value                                        0.000

[...]

Would I interpret the p value as indicating significant differences between the three models then?

Thank you for your help :)

On Tuesday, October 1, 2019 at 12:38:03 PM UTC+1, Edward Rigdon wrote:
Olaya--
     Your syntax would be better than your results as a guide to what analysis was conducted, though there are clues.
     You *did* get chi-squares for all three groups, but chi-square was 0 for 2 of the groups. If this is real data, then random sampling error would keep chi-square from being exactly 0 unless the model is saturated (degrees of freedom or DF = 0). Therefore, the model you actually estimated was saturated in 2 groups but had 2 effective constraints in one group.
     In addition, if the model were the same in all 3 groups but estimated separately in each group, then degrees of freedom would have to be a multiple of 3--DF in a single group times 3 groups. With 2 DF total, this cannot be so.
     Therefore, your syntax produced a model with 2 constraints in 1 group and saturation in the others. The model that you describe--2 predictors with direct effects on 2 outcome variables, with residual covariance between predictors and between outcomes--sounds saturated to me, so DF should be 0. So it seems most likely that there is an error in your syntax involving the first group. With that error resolved, however, chi-square will be 0 for all 3 groups, because the model will be saturated in all 3 groups.
--Ed Rigdon

To unsubscribe from this group and stop receiving emails from it, send an email to lav...@googlegroups.com.

Edward Rigdon

unread,
Oct 1, 2019, 9:01:05 AM10/1/19
to lav...@googlegroups.com
Olaya--
     The model is now fully saturated. With 0 degrees of freedom, the model must fit the data perfectly, as indicated by chi-square = 0. The baseline chi-square only tells you that the "independence model" (all observed variables mutually uncorrelated) does not fit well. So you cannot tell from these fit index results whether there are any "statistically significant" differences across models. Depending on what you mean by "differences," you might impose across-group constraints and thus obtain positive degrees of freedom and a basis for conducting statistical tests.
--Ed Rigdon

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/4c3a7658-bb1a-4677-963f-44d5e63f3d8d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages