Mulit-group SEM, no variance in covariate in one group, how to proceed?

90 views
Skip to first unread message

Alexander Jung

unread,
Nov 21, 2023, 11:07:46 AM11/21/23
to lavaan

Dear Group,

I try to fit a multigroup SEM in lavaan.

In one of my groups (group 1) all values for a specific covariate are the same (i.e., all students in this group are in grade 5), in my other two groups however this covariate (grade) varies between students. I want to compare other regression coefficients between groups, while controling for the grade in all groups but in group 1. (In other groups 2 and 3 I scale the covariate "grade" as a deviation of grade 5, the level of all students in group 1). 

This seems to not be easily possible, lavaan gives the following error message: "lavaan ERROR: some variables have no variance in group 1: grade".

This is my (simplified) model syntax:

    T2   ~ T1 + S1 + grade
    S2   ~ S1 + T1 + grade

    T1   ~~ S1 + grade
    S1   ~~ grade 

Can someone give me advice on how to implement my intended analysis?

(I would need an approach that also works for categorical covariates, as the same is also the case for a categorical second covariate "school-type" that varies in groups 2 and 3 but not in group 1)

I would be super happy about advice.

All the Best,

Alex

Edward Rigdon

unread,
Nov 21, 2023, 12:01:27 PM11/21/23
to lav...@googlegroups.com
     Just being practical, you might replace your actual covariate with another variable which is equal to the real covariate in most groups but is just random noise in the one group. If you leave the covariate's paths fixed at 0 in that one group where your real covariate has no variance, that should address your problem. You could make these random numbers ordinal by using the cut() standard function in R.

--
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/763973ef-81f8-4d23-88b9-aa90867df660n%40googlegroups.com.

Alexander Jung

unread,
Nov 22, 2023, 5:39:47 AM11/22/23
to lav...@googlegroups.com
Thanks a lot for this suggestion, Edward!

The approach works and parameter estimates are correct (in a model without any constraints across groups, parameter estimates in the single groups are identical to estimates for separate single group models for each of the groups). The only disadvantage is that it impacts the overall fit; I added the smallest random variances I could for the model to still converge (sd=0.01), this lead to the following fit in an otherwise saturated model: 
 
cfi     tli     rmsea    srmr    chsq       
1.000   1.027   0.000    0.022   12.291 (2.5% of baseline.chisq) 

My conclusion: It is possible to do it as you suggested, but would be easier to report if this workaround would not be necessary.
Do any of you know of other software that may not require this step?

Thanks again and all the Best,
Alex

You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/xOrS-Pty6l8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/CAHxMgedULjXysOvXpmVufLrhk4w%2Bz%3DYh%2BojcFGeEUOrb-oix-A%40mail.gmail.com.

Terrence Jorgensen

unread,
Nov 22, 2023, 6:46:06 AM11/22/23
to lavaan
This was cross-posted on CrossValidated: 


I recommend providing that link when you post here, so future readers can check for existing answers.  And you can also include a link to this thread as a comment on the CrossValidated post.

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Alexander Jung

unread,
Nov 22, 2023, 7:04:24 AM11/22/23
to lavaan
Thanks for your response on stack overflow, Terrence, I appreciate it!
And also thanks for posting the link here!

All the Best,
Alex


Reply all
Reply to author
Forward
0 new messages