Announcement

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

  • Error in Calculating Propensity Score: logit failed to estimate propensity scores

    Dear Stata Members,

    I am trying to see the effect of removing making policy (this is my treatment) on covid cases and am using teffects psmatch command:

    teffects psmatch (y) (t x1 x2), gen(match)

    I first ran the command using a dataset with around 3000 observations and got good results.

    Now I am running the same command on the same dataset but with around 20,000 observations. But I see the error: "logit failed to estimate propensity scores. computations cannot proceed"
    I tried with probit and received the same error.

    Can anyone please help me with this?

    Thanks

  • #2
    Evidently, something is going wrong when -logit- tries to run, but Stata isn't saying what. Try again, but -set trace on- before you run it. This will give you a lot of extra output, including the ouput (including error messages) that -logit- creates.

    Comment


    • #3
      Thank you for you response, Clyde.

      I re-ran the command with trace on. After 250 iterations, I received a "convergence not achieved" message and the error: "logit failed to estimate propensity scores; computations cannot proceed".

      Is there any way to fix the convergence issue?

      Thanks

      Comment


      • #4
        Well, the simplest cause of non-convergence in logistic regression is if there is a marked difference in the scaling of some of the predictor variables. So, for example, if most of the variables have values ranging in the hundreds, and you have some other variable whose values are typically like 10-5, or, in the other direction, like 109, this can cause convergence difficulties. Rescaling some of the variables so that the ranges of values are more similar often solves the problem.

        If that problem does not exist in your data, or if rescaling fails to solve the problem, you need to re-run that same logistic regression by itself. Then the first step is to look at the iteration log. Usually in the period leading up to convergence failure, the log likelihood is just repeating itself, or perhaps running around in a small cycle. Then you need to look back in the iteration log to see the point at which it got stuck. Then re-run the logistic regression again, but this time specify the -iterate(#)- option, choosing # to be the number of iterations needed to stop just shortly after the calculations got stuck. The logistic regression will run for the specified number of iterations and then stop and show the interim output. This interim output is not a valid solution to the logistic regression, but inspecting it can often identify the source of the convergence problem. You may see some regressors whose coefficients or standard errors are outlandish. If you find such things, they are problematic variables that you must remove from the model to get it to converge. (Before removing them, however, you should inspect the values of those variables carefully as the data may be incorrect, and correcting the data may salvage the situation.)

        Sometimes, however, the iteration log shows the log-likelihood moving along, apparently without difficulty, and then abruptly at some point it quits and says there is a discontinuity in the likelihood function. That's a more difficult problem, and I don't know of any solution to it. I have to say, also, that I have never encountered this particular form of non-convergence in a simple logistic regression; I have only seen it in multi-level models. So I don't think you will find this here.

        If all else fails, I would say start over from scratch. Build up your propensity model slowly, adding one variable at a time, and include as many of them as you feel are important as you can until you hit failure. Then leave that one out and try adding a different one and continuing, and so on. With repeated trial and error you should be able to find a reasonable subset of your variables that you can use without a problem.

        Comment

        Working...
        X