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