Announcement

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

  • mixed versus meglm with continuous outcome -- not arriving at same solution

    I am trying to run what I believe is equivalent code however, I am getting an error message when I run the meglm code. Is there other syntax I should be using to achieve the results obtained from mixed.

    mixed code: (note edited to include year, which does allow the code to run)
    mixed lnallcrimes target##pp year || citycode: || study_area:

    meglm code:
    meglm lnallcrimes target##pp year || citycode: || study_area: , family(gaussian)

    error messages (i get two different errors, it changes)
    either:
    cannot compute an improvement -- discontinuous region encountered
    or
    Hessian is not negative semidefinite

    thank you! any help would be appreciate and if this has been answered elsewhere sorry.
    Last edited by Spruha Joshi; 14 Jul 2016, 11:16.

  • #2
    Well, your -meglm- command includes a variable, year, that is not part of your -mixed- command, so there is no basis for expecting the same results from the two commands.

    The error messages you are getting from -meglm- indicate that Stata is having trouble climbing the likelihood hypersurface. There are numerous possible reasons for this. The first thing you need to do is get a sense of where Stata is when things are going wrong. So re-run the second command adding the -iterate(#)- option, specifying for # a number of iterations that gets you to just before the error message pops up. At that point Stata will halt estimation and show you its results up to that point. You may find coefficients or standard errors that are unreasonably large, or unreasonably small. You may find variance component estimates that are marching towards 0 (near-0 variance components cause all sorts of convergence problems) or towards infinity. One you see where the problems are, it may be possible to find a way around them. Since the problem seems to arise when you add year to the model, I suspect that either the results for year itself will be strange, or it may be that the relationship between year and some other variables is causing the estimates for those other variables to go awry. But you'll have to see what comes out before anyone can say anything more specific.

    Comment


    • #3
      Thank you!

      Not including "year" in was copy paste error on my part, the code does indeed run with year for mixed.
      Thank for the suggestion using the -iterate(#)- option.

      Comment

      Working...
      X