Announcement

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

  • STATA omits variables: How can I deal with it?

    Hi everyone!
    STATA omits two of my independent variables when I run a logit regression model. It sends this message:

    note: Gender != 0 predicts failure perfectly
    Gender dropped and 390 obs not used

    note: MaritalStatus != 0 predicts failure perfectly
    MaritalStatus dropped and 60 obs not used


    I was wondering if someone could help me with this issue.

  • #2
    Well, it will be hard to help you without seing the data (please post some using dataex, type ssc install dataex)
    Also please post the exact code you typed.

    However, the error message is clear enough, some observations are perfectly predicted by those characteristics (gender or marital status), which prevents the analysis.

    Without the code and the data I cannot say more.

    Comment


    • #3
      When, say gender != 0 always associates with the same outcome, then the maximum likelihood estimate (which is how -logit- fits logistic regression models) of the coefficient for gender would be infinite. Stata (and most other statistics programs) is smart enough to recognize this problem ahead of time, and instead of starting on an iteration that is doomed to never converge, it tells you about the problem and eliminates the offending observations and variable.

      So, what should you do?

      The first thing is to be sure that the invariable association of gender and with marital status with outcome failure does not represent a mistake in your data. Perhaps in the course of data management you have somehow dropped out cases which need to be retained. Another possibility is that this relationship does not hold in your data set, but does in the data set that is used for your -logit- estimation, namely those observations that have no missing values for any of the variables that appear in the -logit- command. It may also be a sign that, with those restrictions, the estimation sample has gotten really small.

      If, after inspecting your data, you are persuaded that your data is correct, then you cannot do the analysis you planned. You can omit gender and marital status from your model if that is consistent with your research goals. If it is not, then you have to use a different analytic approach. The -exlogistic- command fits logistic regression models without using maximum likeilhihood and can estimate models with perfect prediction. But be warned: it is computationally intensive and uses up enormous amounts of memory. Unless your data set is pretty small, you may have difficulty running it.

      Comment

      Working...
      X