Multi-group path analysis - Equality-constrained versus free model

185 views
Skip to first unread message

Ronald Bahamondes-Álvarez

unread,
Nov 25, 2023, 8:55:36 AM11/25/23
to lavaan
Hello lavaan group,

I am working on a multi-group path analysis using lavaan (I only have observed variables); however, it has been a challenge to find literature on this. Most of the literature is intended for SEM; however, since I am doing path analysis, there are many steps/considerations that do not apply to path analysis.

I am trying to compare my model across 3 gender groups. Following the literature, I assigned vectors to the parameters to unconstraint them. Looking at the summary, I do see that the estimates vary across groups. However, when I try to compare this unconstrained model with the constrained model (for which I used the argument group.equal = "regressions"), I see exactly the same results in the summary of the constrained and unconstrained group, which seems strange  and makes me think I did something wrong.

Model_de_groups<- '

 ## Direct Paths 
  Sense_of_defeat_centered ~ c(a1, a2, a3) * Sense_of_entrapment_centered
  Intention_to_kill_self_centered ~ c(b1, b2, b3) * Sense_of_defeat_centered +
                                     c(d1, d2, d3) * Sense_of_entrapment_centered
  Perceived_capability_for_suicide ~ c(c1, c2, c3) * Intention_to_kill_self_centered

  ##Indirect effects on Perceived_capability_for_suicide for each group
  g1.indirect1 := a1 * b1 * c1    # Group 1
  g2.indirect1 := a2 * b2 * c2    # Group 2
  g3.indirect1 := a3 * b3 * c3    # Group 3

  g1.indirect2 := d1 * c1         # Group 1
  g2.indirect2 := d2 * c2         # Group 2
  g3.indirect2 := d3 * c3         # Group 3

  ## Total effect on Perceived_capability_for_suicide for each group
  g1.total_effect := c1 + g1.indirect1 + g1.indirect2
  g2.total_effect := c2 + g2.indirect1 + g2.indirect2
  g3.total_effect := c3 + g3.indirect1 + g3.indirect2

  ## Variances for each group
  Sense_of_defeat_centered ~~ c(v1, v2, v3) * Sense_of_defeat_centered
  Intention_to_kill_self_centered ~~ c(w1, w2, w3) * Intention_to_kill_self_centered
  Perceived_capability_for_suicide ~~ c(x1, x2, x3) * Perceived_capability_for_suicide

'
#Multigroup

fit.gender.difference= sem(Model_de_groups, data_, estimator = "MLM", group = "Gender")
summary(fit.gender.difference , fit.measures = T, standardized = T)

fit.gender.equal= sem(Model_de_groups, data, estimator = "MLM", group = "Gender", group.equal = "regressions")
summary(fit.gender.equal , fit.measures = T, standardized = T)


Then, when trying to compare the equality-constrained versus the free model, I get this warning:

> Anova_results=anova(fit.gender.difference, fit.gender.equal)

Warning message:
In lavTestLRT(object = object, ..., model.names = NAMES) :
  lavaan WARNING: some models have the same degrees of freedom

Do you have any idea of what I am doing wrong?

Thank you in advance,
Ronald. 
_
R. Bahamondes-Álvarez MPhil, MSc | CAD-1 Assistant Coordinator ABO | PhD Candidate in Child and Adolescent Psychiatry - LUMC | Leiden University | Faculty of Social Sciences | Wassenaarseweg 52 | 2333 AK Leiden | The Netherlands

Shu Fai Cheung (張樹輝)

unread,
Nov 25, 2023, 8:03:07 PM11/25/23
to lavaan
You can check the parameter estimates. I guess the regression coefficients are not constrained to be equal even you added group.equal = "regressions" because you used labels on the regression paths (e.g., c(a1, a2, a3)). The argument may not override what you explicitly declare as unconstrained.

To constrain the regression coefficients without writing another version of the model with labels removed, you can manually add the equality constrains this way:

Model_de_groups_eq <- paste(Model_de_groups,
"
a1 == a2
a2 == a3
b1 == b2
b2 == b3
c1 == c2
c2 == c3
d1 == d2
d2 == d3
")

If you fit this model, you should see that the regression paths are constrained between group, with or without group.equal = "regressions".

My two cents.

-- Shu Fai
Reply all
Reply to author
Forward
0 new messages