Announcement

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

  • R2000 in logistic regression and I can't find what is missing

    First off I want to say that I am new to Stata and also to statistics. I have searched for a solution to my problem on numerous sites but I haven't found anything that matched.

    I have 45 observations and 5 independent variables, all numeric, and one of them is binary (Democracy, coded as 0 and 1). When i try to do the logistic regression, I get the message:

    note: Democracy != 1 predicts failure perfectly
    Democracy dropped and 22 obs not used

    outcome = GDPpercapita > 3485.1 predicts data perfectly
    r(2000);


    I really don't understand why Democracy (my dichotomous variable) is being omitted?

    I am grateful for all help I can get. Thank you.

  • #2
    Hampus:
    welcome to this forum.
    -logit- (-logistic-) machinery works well when there's variation in the 0/1 sequence (regressand) and predictors with respect to regressand.
    I would recommend to inspect your data and see whether or not these variations exist.
    Among many valuable textbooks on logistic regression, one of my favourite sources is the one written by the deeply missed Joe Hilbe (https://www.stata.com/bookstore/logi...ession-models/).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      The situation resembles this:


      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float(y x)
      1 1
      1 1
      1 1
      0 0
      0 0
      end
      
      
      . logistic y x
      outcome = x > 0 predicts data perfectly
      r(2000);
      r(2000) doesn't always means missings. It means in general no observations to do that with. Once we have set aside perfectly predicted observations, there are no others. If for example, the outcome is "being a cat" and the predictor is "eats cat food", then the problem could be tautology. Your result may be a discovery or a banality but there is nothing for the command to fit.

      Comment


      • #4
        Thank you very much for your answers. It helped me move forward and exclude the variable as it did not fit into the regression.

        Comment


        • #5
          Originally posted by Nick Cox View Post
          The situation resembles this:


          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input float(y x)
          1 1
          1 1
          1 1
          0 0
          0 0
          end
          
          
          . logistic y x
          outcome = x > 0 predicts data perfectly
          r(2000);
          r(2000) doesn't always means missings. It means in general no observations to do that with. Once we have set aside perfectly predicted observations, there are no others. If for example, the outcome is "being a cat" and the predictor is "eats cat food", then the problem could be tautology. Your result may be a discovery or a banality but there is nothing for the command to fit.
          I also encountered such a problem for the first time and your explanation was excellent

          Comment

          Working...
          X