Announcement

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

  • gsem - compare coefficients across models - convergence issues

    Dear all

    I am using multi-level gsem to compare the effect of X on Y1, Y2, Y3, and Y4 which are different (dichotomous) dependent variables. The data consist of 50.000 individuals nested in 200 localities, and I need to adjust for 40 fixed effects.
    First, I run comparisons between Y1 and Y2, Y1 and Y3 etc. Second, I seek to test for overall differences in the effect of X across all dependent variables. For the second step, I am using the following code:

    Code:
    gsem (Y1 <- $controls X  L1[LocalityID] ) ///
              (Y2 <- $controls X  L2[LocalityID]) /// 
              (Y3 <- $controls X  L3[LocalityID]) /// 
              (Y4 <- $controls X  L4[LocalityID]) /// 
                     , latent(L1 L2 L3 L4) family(binomial) link(logit) nocapslatent  
    gsem, coeflegend
    test  _b[Y1:X]= _b[Y2:X] = _b[Y3:X] = _b[Y4:X]
    While the first step works out fine, the second step of comparing all coefficients at once never convergences.
    What can I do to also run this test?

    Thank you very much in advance!

    Best

  • #2
    I don't know what your first step is, but on a reasonably fast multicore processor with that many observations and especially latent factors, convergence should take about a year. Is that what you mean by "never convergences"?

    Comment


    • #3
      Dear Joseph

      Thank you for your reply.
      Sorry for not being sufficiently clear about the first step.

      I was referring to the comparing only 2 rather than all 4 coefficients. That is:

      Code:
      gsem (Y1 <- $controls X  L1[LocalityID] )  (Y2 <- $controls X  L2[LocalityID]), latent(L1 L2) family(binomial) link(logit) nocapslatent 
      gsem, coeflegend
      test  _b[Y1:X]= _b[Y2:X]
      This test takes a few hours but then converges.

      The 4-equation test "never converges" in the sense that even after 5000 iterations no convergence is reached. I am running the model on a reasonably fast multi-core with 32GB RAM etc (though without a Stata MP license).

      Is there anything I could do to increase my chances of convergence?

      Which alternative would there be to compare coefficients across 4 models?
      The key challenge is that these coefficients stem from higher-level independent variables, i.e. they do not vary at the individual-level (n=50.000) but only at the locality level (n=200).
      The need to adjust the standard errors for nesting effects is what is causing the computational intensity, but perhaps there is a better way than using gsem?

      Thank you in advance.
      ​​​​​​​

      Comment

      Working...
      X