Announcement

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

  • xtmixed fails to converge, Stata 12.1

    Dear Colleagues.

    I've been estimating xtmixed models (stata 12.1) and cannot get them to converge. The models just iterate indefinitely until I break it (I let it run over 24 hours). I'm running the models remotely through a proxy server, which generally prevents me from obtaining the logs except under unusual circumstances. Thus, I don't have the specific error code in every case. But, in the small set of cases I have seen, it's just the "non concave" and "backup" then attempts to converge ad infinitum.

    I've already followed stata's advice by (a) ensuring that there are sufficient level 1 observations in each level 2 group and (b) verifying that there are not variance components in the model that shouldn't be there (i.e. that are almost zero) by implementing the emonly command. Implementing the emonly command returns results that seem meaningful at face value, but stata will not generate standard errors FOR THE VARIANCE COMPONENTS with the emonly option. The fact that emonly does return results and the variance components of the random effects are much larger than zero should suggest that the model is identifiable, right?

    Because I'd like those standard errors, does anyone have any advice for troubleshooting? I haven't found anything beyond (a) and (b) on the list.

    Thanks!

    Matthew

  • #2
    Hello, "mahutga" (please re-register with your name and family name, just by clicking on the "contact us" below to right),

    First, xtmixed turned into mixed in Stata 13.

    Lack of convergence cannot be taken as a totally unexpected situation when one delves into mixed models. Quite on the contrary.

    Sometimes, if the iterated values change slightly (not your case, it seems), it may be a question of patience. Sometimes, there may be a problem with the model (check the variables and see if their scales are reasonble overall), oftentimes related to the covariance structure you specified. You could first try a simplified version of the model (only random-intercepts for example) and then go upwards in terms of complexity.

    Finally, since you didn't show your commands, neither presented some information on the design and the variables, this is the furtherst I can go in terms of suggestions.


    Best,

    Marcos
    Last edited by Marcos Almeida; 09 Jan 2015, 14:39.
    Best regards,

    Marcos

    Comment


    • #3
      Dear Marcos.

      Thanks for your reply. I've sent the email to re-register (Matthew Mahutga). I realize that xtmixed is now mixed, but the proxy server I'm using is only compatible with 12.1, so I'm stuck there (but I can't see that much has changed across versions).

      Patience: Therein lies the problem--the proxy server limits my patience for me. It kills jobs itself when they take too long, and I don't even get the log to help me diagnose the problem.

      Simple first: I tried this first by estimating only a random intercept model with an independent error structure and second by including a random coefficient model also with an independent error structure.

      Commands--I'm sure they're right, but hopefully: xtmixed wage highed mediumed age age^2 male married skill level2 level2*skill || country: skill

      The data are individuals nested in countries.

      variable scales: embarrassingly, I'm not sure what this means exactly. highed mediumed male married and skill are dummy variables, level 2 is a continuous ranging from 0 to 5. age is obviously continuous, so age^2 seems to me the only variable that could cause the problem.

      Thanks again!

      Matthew Mahutga


      Comment


      • #4
        Hi Matthew,
        As Marcos suggested, show us the codes you have used and outputs Stata generated. That will be more effective than thousand words. Please use code delimiters (A button right hand side and then click "#" button and paste your output between the two [code] delimiters) to paste your codes.
        Roman

        Comment


        • #5
          PS.

          Age isn't the culprit--I get the same problem if I exclude it and the squared term entirely. Do you know if the emonly option would estimate variance parameters that are consistent enough to assess whether they are actually zero? I understand that to be a common problem leading to failed convergence.

          Comment


          • #6
            When a model is not converging, it is often a good idea to re-run it just a short way past the point where it starts spinning its wheels. This is done with the -iterate- option. So, for example, if your model is getting stuck after 100 iterations, just run -xtmixed whatever, iterate(105)-. (Allow a few more iterations than just the start of where it looks stuck, because sometimes it is still actually making progress, but the change in the likelihood ratio estimate is too small to show up as formatted on the screen.) The model will then stop after 105 iterations and show you its results up to that point. You can then look for signatures of trouble such as outlandishly large standard errors, or missing standard errors, or variance components that are marching towards zero, or outlandish coefficients.

            Another thing to think about is the scales of your variables. Convergence is harder to achieve when, say, one variable can be 10,000 times as large as another. Sometimes all that's needed to get convergence is to change the scale of one or a few variables so that all of the variables range over the same order of magnitude.

            Those are just general ideas, but in my experience, they often solve the problem.

            Comment


            • #7
              By the way, with regard to the proxy server limiting your patience, I do some of my work over a VPN on a remote server. If I keep my connection on too long with no active keyboard or mouse input, it throws me off. But, at least in my situation, if I disconnect voluntarily without shutting down my Stata session or logging off of the remote computer, Stata will keep running. I just have to re-connect to the VPN and log back in to the remove computer from time to time to check on what's happening. I don't know if this will help you or not, but I thought I'd mention it.

              Comment


              • #8
                Many sugestions already being given, I wish to share some comments from a recently-published book on the matter (West, Welch, Gatecki. Linear mixed models: a practical guide using statistical software, 2nd edition, CRC Press)

                The authors use the term "aliasing" to refer to problems with model specifications. Intrinsic aliasing would happen due to the model array of commands. Extrinsic aliasing would happen due to the characteristics of the data.

                Now, going directly to the point worth being mentioned so as to give some clues on what might also be happening in your case:

                "Most commonly, intrinsic aliasing is encountered in linear models involving categorical fixed factors as covariates".

                Not to be missed, the comment on the reliability of standard errors where there are problems of convergence:

                "In all these instances, parameter estimates and their standard errors may be invalid and should be interpreted with caution".

                Hope it helps.

                Best,

                Marcos
                Best regards,

                Marcos

                Comment

                Working...
                X