Regression Coefficient Comparison of two groups (multigroup in lavaan)

744 views
Skip to first unread message

Saeed Abbas Shah

unread,
Sep 26, 2022, 12:07:07 PM9/26/22
to lavaan
Hello,

Similar question have been discussed earlier but could not grasp it totally as I am new to R programming and research.

I have run my SEM in lavaan for ordinal data by using (ordered=TRUE ) argument.

Now my main objectives for multigroup SEM is to check that the difference between  regression coefficients is statistically significant or not ? for both groups.

1. What should I put in group.equal = c( ) argument?
2. If I compare the base model (free) with constrained model, if the p value <0.05 means the difference between regression coefficients is statistically significant or not?

model1 = 'LV1=~a1+a2+a3
LV2=~b1+b2+b3
LV3=~c1+c2+c3
LV4=~d1+d2+d3
LV5=~e1+e2+e3
LV6=~f1+f2+f3

LV3~LV1+LV2
LV4~LV3+LV1+LV2
LV5~LV4+LV3+LV1+LV2
LV6~LV5+LV4+LV3+LV1+LV2'

modelfit1 = sem(model1, data = data, group = "group", ordered = TRUE)

Kindly if you may provide stepwise guidelines for my objective (to know the difference between regression coefficients between two groups), would really appreciate it.

Ole Schacht

unread,
Sep 27, 2022, 9:20:44 AM9/27/22
to lavaan
How I would personally proceed is through the specification of labels in your model. Labels are used to capture, test, constrain or compare certain parameters in the model, which can also be done across groups. Image that you want to investigate whether the regression coefficients for the predictors LV1 and LV2 for the criterion variabele LV3 (your first regression) are equal across groups (I think this corresponds with your question). To achieve this; you could specify in your model LV3 ~ c(a1, a2)*LV1 + c(a3, a4)*LV2. So here; you capture the coefficients across groups in the labels a1 through a4.

In the next step, you need to specify the difference between these parameters across groups in the following way:
diffLV1 := a1 - a2
diffLV2 := a3 - a4

This then allows the statistically test whether the coefficients across groups are significantly different. Your code would thus look something like this:


model1 = 'LV1=~a1+a2+a3
LV2=~b1+b2+b3
LV3=~c1+c2+c3
LV4=~d1+d2+d3
LV5=~e1+e2+e3
LV6=~f1+f2+f3

LV3 ~ c(a1, a2)*LV1 + c(a3, a4)*LV2
LV4~LV3+LV1+LV2
LV5~LV4+LV3+LV1+LV2
LV6~LV5+LV4+LV3+LV1+LV2

diffLV1 := a1 - a2
diffLV2 := a3 - a4  '

modelfit1 = sem(model1, data = data, group = "group", ordered = TRUE)
summary(modelfit1, standardized=T, fit.measures=T)

Note that the group.equal argument implicitly constrains parameters to equality across groups; and through using labels you can do this manually for certain parameters, as we just did. You could alternatively fit the model shown above; and also fit a model with a1 and a2 being equal (you both label them a1), and likewise for a3 and a4 (label them a3 in both groups; so c(a3, a3)). You can then test this nested model with the model shown above and check for deterioration in model fit. The method first explained does give you more information though.

Hope this clarifies your question!

-Ole

Op maandag 26 september 2022 om 18:07:07 UTC+2 schreef s.a...@iba-suk.edu.pk:

Ole Schacht

unread,
Sep 27, 2022, 9:26:57 AM9/27/22
to lavaan
To correct myself; we did not constrain the parameters to equality across groups in this model, but it's possible to do this.

-Ole

Op dinsdag 27 september 2022 om 15:20:44 UTC+2 schreef Ole Schacht:

Chesnut, Ryan

unread,
Sep 27, 2022, 9:39:07 AM9/27/22
to lavaan
I believe for a valid comparison of the regression coefficients in the structural model, you would need to establish metric invariance in the measurement model first. Terrence Jorgensen has developed a function that helps to write the syntax needed to examine invariance (https://rdrr.io/cran/semTools/man/measEq.syntax.html). The examples at the bottom of the page are very helpful. Note that if your observed indicators are binary, you need to constrain thresholds, loadings, and intercepts simultaneously. Once you have the right syntax for the measurement portion of the model, you can do what Ole suggested to compare the coefficients in the structural portion.

---
Ryan P. Chesnut, PhD
Assistant Research Professor
Clearinghouse for Military Family Readiness
The Pennsylvania State University
402 Marion Place
University Park, PA 16802


From: lav...@googlegroups.com <lav...@googlegroups.com> on behalf of Ole Schacht <schac...@gmail.com>
Sent: Tuesday, September 27, 2022 9:26 AM
To: lavaan <lav...@googlegroups.com>
Subject: Re: Regression Coefficient Comparison of two groups (multigroup in lavaan)
 
You don't often get email from schac...@gmail.com. Learn why this is important
--
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/383b1b27-1470-4750-ab53-dbb0c0e5d4a3n%40googlegroups.com.

Keith Markus

unread,
Sep 28, 2022, 8:34:54 AM9/28/22
to lavaan
Two thoughts...

First, I am not a statistician but it has been my understanding that the chi-square difference test is more accurate and the preferred test for core hypotheses.  Moreover, following the lead of Cohen, Cohen, West & Aiken's regression book, I might proceed as follows.

1. Fit a model with no equality constraints across groups.
2. Using parameter labels, give all the effect coefficients of interest the same label in each group and fit this model which constrains them all to equality.
3. Use the chi-square difference test as an omnibus test of the hypothesis that they are all equal across groups.
   a. If the difference does not reach statistical significance then stop and conclude that they are all equal across groups.
   b. If the difference does reach statistical significance, then proceed to step 4.
4. Compare the first model with no equality constraints to a model constraining only one effect coefficient to equality between groups and repeat for each coefficient of interest.  Use the results to draw conclusions about which are equal across groups.

Note: The idea is that the omnibus test "protects" the single-coefficient tests from alpha inflation.  The reason for using the model with no constraints to test individual parameters is that the chi-square difference test assumes that the nesting model is correctly specified and the model with the fewest constraints has the best chance of meeting this assumption.

Second, it seems to strong to say that the test is not valid without measurement invariance.  As a statistical test of the equality of two parameters, it seems to me that the test remains valid without measurement invariance.  Nonetheless, any differences have two potential explanations (a) differences in causal effects or (b) differences in measurement.  So, if one wishes to assert the former explanation, then the latter functions as a plausible rival hypothesis and one can view this as a case of Campbellian validity.  However, that is the validity of the inference regarding hypothesis a, not the validity of the test of the equality constraint.

Please correct me if I am missing something.

Keith
------------------------
Keith A. Markus
John Jay College of Criminal Justice, CUNY
http://jjcweb.jjay.cuny.edu/kmarkus
Frontiers of Test Validity Theory: Measurement, Causation and Meaning.
http://www.routledge.com/books/details/9781841692203/

Saeed Abbas Shah

unread,
Oct 10, 2022, 9:36:34 PM10/10/22
to lav...@googlegroups.com
Thank you all ( Ole, Ryan and Keith) for your valuable guidance.

In my case the measurement invariance is not established, so does it mean that I can not run multigroup analysis on this group or is there any other alternative? because the grouping variable is really important for my study.

Thanks
Regards
Saeed 



--
Syed Saeed Abbas
Assistant Professor (Marketing)
Business Administration Department
Sukkur IBA University, Pakistan.

Keith Markus

unread,
Oct 11, 2022, 10:00:16 AM10/11/22
to lavaan
Saeed,
I believe you have already been through levels of invariance and have focused on the appropriate level for mean comparisons.  The next thing to consider is how many items the scales have.  If you have more than a few items in each scale, it may be worth investigating partial invariance, which means that invariance holds for a subset of items but not all of them.  If you can find an invariant subset of items, you may be able to use those for mean comparisons across groups.  If not, then you can report the descriptive results with the explanation that you cannot distinguish group differences in means from group differences in how they respond to the scales.  You can report the measurement invariance analysis and offer a word of caution for other researchers using the same measure to compare mean differences.

KM

Saeed Abbas Shah

unread,
Feb 27, 2023, 2:12:03 AM2/27/23
to lav...@googlegroups.com
Dear Ole, 
Thanks for your valuable suggestions regarding the comparison of regression coefficients in SEM Multigroup analysis in lavaan. 

You suggested following method of comparison after the measurement invariance is established: 

model1 = 'LV1=~a1+a2+a3
LV2=~b1+b2+b3
LV3=~c1+c2+c3
LV4=~d1+d2+d3
LV5=~e1+e2+e3
LV6=~f1+f2+f3

LV3 ~ c(a1, a2)*LV1 + c(a3, a4)*LV2
LV4~LV3+LV1+LV2
LV5~LV4+LV3+LV1+LV2
LV6~LV5+LV4+LV3+LV1+LV2

diffLV1 := a1 - a2
diffLV2 := a3 - a4  '

modelfit1 = sem(model1, data = data, group = "group", ordered = TRUE)
summary(modelfit1, standardized=T, fit.measures=T)

1. I was wondering if the comparison is done within constrained model or this comparison is done in SEM base / configural model ? 
2. Should I do above mentioned method for all structural paths simultaneously or each path one time ?

I hope to get positive response.

Thanks
Saeed

--
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.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages