Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SEM group comparison: how to compare group means

    Hi Statalist,

    I have been trying to do a measurement invariance via Stata, i.e. validate a measurement tool among 2 populations (female and male) following the 3 steps:



    Step 1:
    Model that frees all parameters: (here I set the mean of the latent variables to 0 and variance to 1, thus to identify their scale and location)

    Code:
    sem (Latent1 -> item1 item2 item3 ) (Latent2 -> item4 item5 item6), ///
    variance (Latent1@1 Laten2@1) mean(Latent1@0 Latent2@0) ginvariant(none) group(gender)



    Step 2:
    Then I checked if factor loadings are equal across groups:

    Code:
    sem (Latent1 -> item1 item2 item3 ) (Latent2 -> item4 item5 item6), ///
    variance (Latent1@1 Laten2@1) mean(Latent1@0 Latent2@0) ginvariant(mcoef) group(gender)



    Step 3:
    Then I came to the conclusion that factor loadings are the same, so I tried to compare the group means.
    In order to do that, I wanted to set mean to 0 and variance to 1 for just group=1, but free estimates for group=2;
    so that I could see if the test for the mean of group=2 is significantly different than 0 (mean of group=1).

    Code:
    sem (Latent1 -> item1 item2 item3 ) (Latent2 -> item4 item5 item6), ///
    variance (1: Latent1@1) variance(1: Laten2@1) mean(1: Latent1@0) mean(1: Latent2@0) ginvariant(mcoef) group(gender)
    However, step 3 codes did not work. Stata keeps iterating and not concaving until I broke the iteration.


    Before this post, I already tried many other different Stata tutorials using the same method, but all just failed in the last step wherein I want to know if the means of my latent variables are different across groups. And if latent means are different, then which one is higher among which groups. I also referred to the Stata "help" document, and I think I am following the same commands. I am confused that I don't know why Stata is not cancaving...


    Thanks for any help/thought in advance! Much appreciated!

    Yingyi

  • #2
    Conceptually, there seems to be missing one step in the testing process: Equal factor loadings are necessary but not sufficient to compare the latent means; the constants need to be equal, too.

    That said, once you have established measurement invariance, the freely estimated mean in one group will be equal to the differences in means, since you are fixing the mean in the other group to
    0. See this blog entry by Kristin MacDonald (StataCrop).

    Concerning convergence problems, from my experience it sometimes helps to fix the mean in the other group, especially when group sizes differ considerably. You may also save the results from a previous model then use these as starting values for the final model.

    Best
    Daniel

    Comment


    • #3
      Originally posted by daniel klein View Post
      Conceptually, there seems to be missing one step in the testing process: Equal factor loadings are necessary but not sufficient to compare the latent means; the constants need to be equal, too.

      That said, once you have established measurement invariance, the freely estimated mean in one group will be equal to the differences in means, since you are fixing the mean in the other group to
      0. See this blog entry by Kristin MacDonald (StataCrop).

      Concerning convergence problems, from my experience it sometimes helps to fix the mean in the other group, especially when group sizes differ considerably. You may also save the results from a previous model then use these as starting values for the final model.

      Best
      Daniel
      Hi Daniel,

      Thanks so much for your kind reply! And yes, I was following the example posted by Kristin MacDonald. And you are right that I added a step of constrianing the _cons before I compare the means with the following codes: And now the codes works as what I wanted.

      Code:
       sem (Latent1 -> item1 item2 item3 ) (Latent2 -> item4 item5 item6), ///
      variance (1: Latent1@1) variance(1: Laten2@1) mean(1: Latent1@0) mean(1: Latent2@0) ginvariant(mcoef mcons) group(gender)
      But a bit confused about you last suggestion. May I ask what do you mean by "save the results from a previous model then use these as starting values for the final model."?

      Thanks again!
      Yingyi

      Comment


      • #4
        Originally posted by Yingyi Lin View Post
        But a bit confused about you last suggestion. May I ask what do you mean by "save the results from a previous model then use these as starting values for the final model."?
        Read intro 12 in the manual to learn about the from() option that allows you to specify starting values (e.g., from another, simpler model).

        Beste
        Daniel

        Comment


        • #5
          Thanks so much Daniel. Intro 12 is very helpful!

          Comment


          • #6
            I am trying something very similar.

            At the end of the first step which allows all parameters to be free

            Code:
            sem (Latent1 -> item1 item2 item3 ) (Latent2 -> item4 item5 item6), ///
                                variance (Latent1@1 Laten2@1) mean(Latent1@0 Latent2@0) ///
                                ginvariant(none) group(groups2)
            when I run the test

            Code:
            estat ginvariant, showpclass(mcoef) class
            the result of the Wald test suggests that we accept the hypothesis of equality of measurement coefficients across the two groups.

            Code:
            Joint tests for each parameter class
            
            ------------------------------------------------------------------------------
                         |            Wald Test                       Score Test
                         |      chi2         df    p>chi2       chi2          df    p>chi2
            -------------+----------------------------------------------------------------
                   mcoef |    10.721          9    0.2953          .           .         .
            --------------------------------

            However, in the very second step where we test for equality of intercepts using
            Code:
            ginvariant(mcoef)
            instead of
            Code:
            (none)
            above, and then testing using

            Code:
            estat ginvariant, showpclass(mcons) class
            I find that the hypothesis of equality of intercepts must be rejected:


            Code:
            Joint tests for each parameter class
            
            ------------------------------------------------------------------------------
                         |            Wald Test                       Score Test
                         |      chi2         df    p>chi2       chi2          df    p>chi2
            -------------+----------------------------------------------------------------
                   mcons |    59.882          9    0.0000          .           .         .
            ------------------------------------------------------------------------------


            So my question is, what sort of measurement invariance is this? It worked only when testing for equality of measurement coefficients, but not even intercepts.
            Last edited by Sam Vega; 03 Apr 2018, 00:27.

            Comment


            • #7
              Hi Yingyi, just one question: In the very first step you seem to fix the latent means to 0 and the latent variances to 1 in BOTH groups, is that correct? Is it actually fair to do so? Literature says to only fix them in 1 group and estimate the other group freely (http://www.agencylab.ku.edu/~agencyl...d,%202006).pdf). However, when I do so, my model doe snot converge. When I fix them in both groups, it does. Is there any reasoning/literature why you have fixed them in both groups? Thanks a lot in advance for your reply!

              Comment


              • #8
                Originally posted by Franziska Bellmann View Post
                Hi Yingyi, just one question: In the very first step you seem to fix the latent means to 0 and the latent variances to 1 in BOTH groups, is that correct? Is it actually fair to do so? Literature says to only fix them in 1 group and estimate the other group freely (http://www.agencylab.ku.edu/~agencyl...d,%202006).pdf). However, when I do so, my model doe snot converge. When I fix them in both groups, it does. Is there any reasoning/literature why you have fixed them in both groups? Thanks a lot in advance for your reply!
                Hi Franziska,

                I followed the steps posted in this blog: https://blog.stata.com/2016/08/23/gr...nt-invariance/

                Hope this helps!

                Yingyi

                Comment

                Working...
                X