Multigroup SEM
Hi everyone,
I have conducted multigroup sem. I had measurement invariance test results as you recommended and they were I expected. Now, I wonder to know how I can write the syntax showing constrained path to be equal in two groups. Thank you for your answer
Comments
I'll pass this on to our experts
Cheers,
E.J.
Dear @derya,
I am not sure what you mean by 'the syntax', but I am assuming you want the lavaan model specification with the group constraints? Please correct me if I am wrong.
The CFA analysis in JASP does not use the lavaan model syntax to specify this, it instead uses the group.equal argument to specify the constraints between groups. So if you select Additional Output -> Show lavaan syntax, these constraints will not show in the model syntax output.
So depending on your use case, I would suggest either:
For the rules of the lavaan syntax for multiple groups, please refer to the lavaan documentation: https://lavaan.ugent.be/tutorial/groups.html
I hope that helps!
Best,
Simon
I am sorry for my missing explanation. Yes, I use lavaan model specification. I cannot see lavaan syntax because I use SEM tab not CFA tab for my analysis. There is no selection Additional Output -> Show lavaan syntax in this tab. Is there any way to see lavaan syntax?
I have tried to explain my research and what I have done. I have three latent variables and I have aimed to examine a basic mediation model in two groups. First, I followed the recommendation in this web site to test measurement invariance : https://jasp-stats.org/2022/01/25/measurement-invariance-testing-using-the-structural-equation-modeling-sem-module-in-jasp/
So, I wrote the syntax for measurement model as below:
# factor loadings
im =~ mot2 + mot11 + mot12
dp =~ dp1 + dp2 + dp3 + dp4 + dp5
cm =~ cm1 + cm2 + cm3 + cm4 + cm5 + cm6 + cm7 + cm8
Second, I tested scalar invariance:
# factor loadings (labeled equal)
im =~ m1*mot2 + m2*mot11 + m3*mot12
dp =~ d1*dp1 + d2*dp2 + d3*dp3 + d4*dp4 + d5*dp5
cm =~ c1*cm1 + c2*cm2 + c3*cm3 + c4*cm4 + c5*cm5 + c6*cm6 + c7*cm7 + c8*cm8
Third, I wanted to test multigroup model. When I selected the multigroup buttom, JASP gave me the results but I can not understand how I can comment these results. I must need to specify which paths are constrained to be equal across the groups. But I dont know how ı can do this by writing syntax. If you have any recommendation, I would be happy.
to specify which paths are equal across groups, you need to set the labels to be the same across groups. For example, if you have two groups and want to fix the factor loading of cm1 to be equal across groups, your last line would be: "cm =~ c(c1, c1)*cm1 + ..."
This specifies explicitely that the label in the first group is c1, and that the label in the second group is also c1 (i.e. the same label, so the same parameter).