I am trying to do SEM to examine measurement invariance across gender groups (male = 0, female = 1, vs. others = 2). The model I am trying to examine is a two-factor structure (latent variables are A and B), each factor consisting of 6 items (a1 a2 a3 a4 a5 a6 and b1 b2 b3 b4 b5 b6). Each item consists of 5-point Likert scale. I am referencing this webpage https://stats.oarc.ucla.edu/stata/fa...mand-stata-12/ to write my code. The code I used for scalar invariance was this:
sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100)
When I run this code, everything runs fine, but the problem is that the variances of both latent factors across groups – which means var(A) and var(B) from all three groups (i.e., 0, 1, 2 of gender) – are all 1. It doesn’t say “constrained.” They are just fixed at 1. So I tried to run configural invariance with exactly the same code except for using ginvariant(none) and metric invariance again with the same code except for using ginvariant(mcoef), and all of the var(A) and var(B) from all three groups are fixed at 1, Which leads to my first question.
Question#1) Is this normal? I don’t think the variances should be fixed. What code should I use to examine scalar invariance in this case?
Question#2) Relatedly, I would like to report the variances of A and B from each group from the scalar invariance model. But since it is all fixed at 1, I can’t. What code should I use to get the variances of each latent factor from each group from scalar invariance?
Subsequently, I ran “estat ginvariant” after the scalar invariance was achieved to examine the latent mean and variance differences. 'Tests for group invariance of parameters' table showed that there were latent mean and variance differences across groups. That said, I would like to report the estimated latent means and variances of each group. Which leads to my third question.
Question#3) What code should I use to fix the mean of one group to 0, and let the mean of the other two groups to vary freely?
I tried using “sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons meanex) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100)” as the website suggests, but it still gives me mean(A) and mean(B) values for all three groups.
Another approach I tried was the following code, but it also doesn’t work.
constraint define 1 _b[A@gender == 0:_cons] = 0
constraint define 2 _b[A@ gender ==1:_cons]
constraint define 3 _b[A@ gender ==1:_cons]
sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100) constraint (1 2 3)
Question#4) What code should I use to fix the variance of one group to 1, and let the variances of the other two groups to vary freely? I tried using the constraints or adding the code covex to ginvariant(covex) - like the website suggests-, but since all variances are already fixed to 1 in all my models, I am not sure what to do. Whatever I try to do, all of the variances are always fixed at 1 across 0, 1, 2 groups.
I have spent the entire week to look for solutions, and I am still at a loss. Could you give me some clarifications on what to do here? Please let me know if you need any additional info on any thing!
Thank you!
sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100)
When I run this code, everything runs fine, but the problem is that the variances of both latent factors across groups – which means var(A) and var(B) from all three groups (i.e., 0, 1, 2 of gender) – are all 1. It doesn’t say “constrained.” They are just fixed at 1. So I tried to run configural invariance with exactly the same code except for using ginvariant(none) and metric invariance again with the same code except for using ginvariant(mcoef), and all of the var(A) and var(B) from all three groups are fixed at 1, Which leads to my first question.
Question#1) Is this normal? I don’t think the variances should be fixed. What code should I use to examine scalar invariance in this case?
Question#2) Relatedly, I would like to report the variances of A and B from each group from the scalar invariance model. But since it is all fixed at 1, I can’t. What code should I use to get the variances of each latent factor from each group from scalar invariance?
Subsequently, I ran “estat ginvariant” after the scalar invariance was achieved to examine the latent mean and variance differences. 'Tests for group invariance of parameters' table showed that there were latent mean and variance differences across groups. That said, I would like to report the estimated latent means and variances of each group. Which leads to my third question.
Question#3) What code should I use to fix the mean of one group to 0, and let the mean of the other two groups to vary freely?
I tried using “sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons meanex) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100)” as the website suggests, but it still gives me mean(A) and mean(B) values for all three groups.
Another approach I tried was the following code, but it also doesn’t work.
constraint define 1 _b[A@gender == 0:_cons] = 0
constraint define 2 _b[A@ gender ==1:_cons]
constraint define 3 _b[A@ gender ==1:_cons]
sem (A -> a1 a2 a3 a4 a5 a6,) (B -> b1 b2 b3 b4 b5 b6,) (a1 <- A _cons@0) (b1 <- B _cons@0), covstruct(_lexogenous, diagonal) group(gender) mean(A) mean(B) ginvariant(mcoef mcons) latent(A B ) cov( A*B ) nocapslatent standardized iterate(100) constraint (1 2 3)
Question#4) What code should I use to fix the variance of one group to 1, and let the variances of the other two groups to vary freely? I tried using the constraints or adding the code covex to ginvariant(covex) - like the website suggests-, but since all variances are already fixed to 1 in all my models, I am not sure what to do. Whatever I try to do, all of the variances are always fixed at 1 across 0, 1, 2 groups.
I have spent the entire week to look for solutions, and I am still at a loss. Could you give me some clarifications on what to do here? Please let me know if you need any additional info on any thing!
Thank you!
Comment