Announcement

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

  • SEM/GSEM issue: Latent variables constrained & GSEM not concave

    Hi - two questions involving an SEM model with weighted panel data.

    1) I am building an SEM with two latent constructs predicting a measured outcome. I am interested in how both latent constructs (each have three items) predict this outcome. However, I can not seem to get STATA to show me the coefficient for both latent constructs. It keeps constraining the second latent variable to 1. I type "nocnsreport" but am getting the same issue. Any suggestions?

    2) In the same model, I was hoping to run GSEM since my outcome is a count variable. However, it is approaching a normal distribution and may not fit the Poisson distribution very well (N=1,479, Mean=3.651116, SD=2.285445, range:0 12). Runs fine in SEM, but won't converge in GSEM. Is this an error with GSEM? Or can I run the model in SEM even though technically this is a count variable?

    Thanks to everyone for their time!

  • #2
    Without seeing any code or output it is difficult to say. But, on #1, my guess is that the model is being identified by fixing that path at 1. If so, fix some other path at 1 to identify.

    I would solve the first problem, and then see if the 2nd problem persists,

    showing code and output may help you get a better answer.

    Put another way, my first guess is that you are specifying the model incorrectly, but without seeing what you”ve done we can”t really tell.
    Last edited by Richard Williams; 13 Dec 2022, 22:05.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Here is the code & output. Thank you so much for responding! Here is the code & output. Of note, the covariances selected were based off of the "estat gof, stats(all) estat mindices" command but the results don't really change at all either way. Thank you!

      sem (L1 -> Q34a_1w11, ) (L1 -> Q34a_2w11, ) (L1 -> Q34a_3w11, ) (hispanicw11 -> L1, ) (ppagew11 -> L1, ) (prehurexpALLw10 -> L1,) (L1 -> climateactionw11, ) (L2 -> Q34a_4w11, ) (L2 -> Q34a_5w11, ) (L2 -> Q34a_6w11, ) (hispanicw11 -> L2, ) (ppagew11 -> L2, ) (educat4 -> L2, ) (prehurexpALLw10 -> L2,) (L2 -> climateactionw11, ) (gender2 -> climateactionw11, ) (ppagew11 -> climateactionw11, ) (prehurexpALLw10 -> climateactionw11, ) [pweight = weightw11], nocnsreport latent(L1 L2) cov( e.L1*e.L2 e.Q34a_1w11*e.Q34a_3w11 e.Q34a_1w11*e.climateactionw11 e.Q34a_> 3w11*e.L2 e.Q34a_1w11*e.Q34a_2w11 e.Q34a_2w11*e.L2) nocapslatent
      (33 observations with missing values excluded)

      Endogenous variables
      Observed: climateactionw11
      Measurement: Q34a_1w11 Q34a_2w11 Q34a_3w11 Q34a_4w11 Q34a_5w11 Q34a_6w11
      Latent: L1 L2

      Exogenous variables
      Observed: hispanicw11 ppagew11 prehurexpALLw10 educat4 gender2

      Fitting target model:
      Iteration 0: log pseudolikelihood = -23013.506 (not concave)
      Iteration 1: log pseudolikelihood = -22145.466 (not concave)
      Iteration 2: log pseudolikelihood = -21816.103 (not concave)
      Iteration 3: log pseudolikelihood = -21711.39
      Iteration 4: log pseudolikelihood = -21674.066
      Iteration 5: log pseudolikelihood = -21659.742
      Iteration 6: log pseudolikelihood = -21659.132
      Iteration 7: log pseudolikelihood = -21657.982
      Iteration 8: log pseudolikelihood = -21657.978
      Iteration 9: log pseudolikelihood = -21657.978

      Structural equation model Number of obs = 1,446
      Estimation method: ml

      Log pseudolikelihood = -21657.978

      ----------------------------------------------------------------------------------------------------
      | Robust
      | Coefficient std. err. z P>|z| [95% conf. interval]
      -----------------------------------+----------------------------------------------------------------
      Structural |
      climateactionw11 |
      L1 | -.9167698 .4093453 -2.24 0.025 -1.719072 -.1144678
      L2 | 1 (constrained)
      ppagew11 | .0216435 .0057948 3.73 0.000 .0102859 .0330011
      prehurexpALLw10 | .4493384 .1460343 3.08 0.002 .1631164 .7355604
      gender2 | .4094415 .1761863 2.32 0.020 .0641228 .7547602
      _cons | 1.64713 .3682647 4.47 0.000 .9253444 2.368915
      ---------------------------------+----------------------------------------------------------------
      L1 |
      hispanicw11 | .2234043 .0852968 2.62 0.009 .0562256 .3905831
      ppagew11 | -.0051013 .001753 -2.91 0.004 -.0085371 -.0016656
      prehurexpALLw10 | .1315016 .0368729 3.57 0.000 .0592321 .2037711
      ---------------------------------+----------------------------------------------------------------
      L2 |
      hispanicw11 | .2666044 .1158999 2.30 0.021 .0394448 .493764
      ppagew11 | -.0065029 .0026582 -2.45 0.014 -.0117129 -.001293
      prehurexpALLw10 | .165791 .0495061 3.35 0.001 .0687609 .2628211
      educat4 | .2628 .0964698 2.72 0.006 .0737227 .4518774
      -----------------------------------+----------------------------------------------------------------
      Measurement |
      Q34a_1w11 |
      L1 | 1 (constrained)
      _cons | 1.533683 .1211403 12.66 0.000 1.296252 1.771114
      ---------------------------------+----------------------------------------------------------------
      Q34a_2w11 |
      L1 | 1.061395 .1392396 7.62 0.000 .7884902 1.334299
      _cons | 1.439356 .1437193 10.02 0.000 1.157671 1.721041
      ---------------------------------+----------------------------------------------------------------
      Q34a_3w11 |
      L1 | .9318193 .1089448 8.55 0.000 .7182913 1.145347
      _cons | 1.307562 .113607 11.51 0.000 1.084896 1.530228
      ---------------------------------+----------------------------------------------------------------
      Q34a_4w11 |
      L2 | .8870135 .2219959 4.00 0.000 .4519096 1.322117
      _cons | 1.743394 .1430707 12.19 0.000 1.46298 2.023807
      ---------------------------------+----------------------------------------------------------------
      Q34a_5w11 |
      L2 | .9702443 .2415568 4.02 0.000 .4968017 1.443687
      _cons | 1.667628 .1519286 10.98 0.000 1.369854 1.965403
      ---------------------------------+----------------------------------------------------------------
      Q34a_6w11 |
      L2 | 1.01283 .2474552 4.09 0.000 .5278267 1.497833
      _cons | 1.831151 .1598418 11.46 0.000 1.517866 2.144435
      -----------------------------------+----------------------------------------------------------------
      var(e.Q34a_1w11)| .2489309 .0676796 .146101 .4241353
      var(e.Q34a_2w11)| .1245587 .033947 .0730112 .2124999
      var(e.Q34a_3w11)| .0392985 .0278365 .0098048 .1575114
      var(e.climateactionw11)| 4.359769 .2562559 3.885368 4.892096
      var(e.Q34a_4w11)| .2755542 .0741774 .1625807 .4670302
      var(e.Q34a_5w11)| .1693925 .0290305 .1210641 .2370136
      var(e.Q34a_6w11)| .2573517 .0333456 .1996343 .3317561
      var(e.L1)| .2643785 .0720535 .1549673 .4510369
      var(e.L2)| .668053 .3060612 .2721713 1.639757
      -----------------------------------+----------------------------------------------------------------
      cov(e.Q34a_1w11,e.Q34a_2w11)| .0866102 .0369848 2.34 0.019 .0141213 .1590992
      cov(e.Q34a_1w11,e.Q34a_3w11)| -.0009754 .0350034 -0.03 0.978 -.0695808 .06763
      cov(e.Q34a_1w11,e.climateactionw11)| .1024735 .0543039 1.89 0.059 -.0039601 .2089072
      cov(e.Q34a_2w11,e.L2)| -.0216165 .0429665 -0.50 0.615 -.1058293 .0625963
      cov(e.Q34a_3w11,e.L2)| -.0475474 .0434546 -1.09 0.274 -.1327169 .037622
      cov(e.L1,e.L2)| .2603415 .0946965 2.75 0.006 .0747398 .4459432
      ----------------------------------------------------------------------------------------------------



      .

      Comment


      • #4
        Hi Dana. I will try to decider this later, but your output would be far easier to read if you used code tags. See the Statalist FAQ.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Sorry - I could not see how indecipherable it looked before I posted. I will work on trying to figure out how to use the code tags.

          Comment


          • #6
            Here it is as a PDF. I deleted the covariances for ease of interpretation. Thanks a million!!!
            Attached Files

            Comment


            • #7
              sem doesn't know what you consider structural and what you consider measurement. It therefore isn't using the constraints you want to identify the latent variables.

              For each latent variable you should explicitly set one of the three paths from latent variable to indicator at 1, e.g. you could do

              Code:
              sem (L1@1 -> Q34a_1w11, )  (L2@1 -> Q34a_4w11, ) etc. ...
              You could pick other paths to fix at 1.

              Or, fix the Latent Variances at 1:

              Code:
              sem ..., var(L1@1) var(L2@1)
              I can't test the above but hopefully this will work and give you more sensible estimates.

              If interested, my brief overview of sem is at

              https://www3.nd.edu/~rwilliam/stats2/l95.pdf
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              StataNow Version: 19.5 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Thank you! That worked great! I appreciate the link as well.

                Comment

                Working...
                X