Announcement

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

  • Logistic regression "outcome does not vary" issue despite 0, 1 dependent variable

    Hello,

    I've been trying to do a logistic regression for a binary variable "job change" which I recoded into 0 and 1(0 is no change with n=1,437; 1 is change with n=691)
    The syntax goes through when I just key in the basic independent variables (gender, age, education) but as soon as I add in additional variables such as wage(continuous variable) or source(categorical variable with 3 categories that total n=1,648) I get the message "outcome does not vary; remember: 0=negative outcome, all other nonmissing values=positive outcome".

    I was hoping someone could help me find out what I've been doing wrong or send me to the right direction to solve this issue.
    Thank you so much!

  • #2
    My quick guess is that you have all missing values for wages or the other variable when you have a switch in the outcome. Can you show the result of

    Code:
    sum wage if job_change==0
    sum wage if job_change==1

    Comment


    • #3
      To elaborate on Andrew's point, maybe some question was only asked if job change = 1. If you add that variable to the model, then all cases with job change = 0 will get dropped.

      If you have the questionnaire, you can check how the skip patterns work. You might be able to create a variable which does not have these problems. For example, people may be asked their marital status. Married people might then be asked "What is your spouse's income?" Cohabitors may be asked "What is your partner's income?" You could combine these 2 variables into a single spouse/partner income variable.

      Also, sometimes when a variable is not asked and is coded as missing, you can plug in zero for it. For example, if you have no job, you won't be asked about your wages, but the wages could be coded as zero.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Thank you so much Andrew and Richard!
        I tried the code Andrew gave me and you were right, my independent variable had all missing values for one side of my binary variable which would explain why I wasn't able to run the logistic regression.
        Thank you for the advice on looking for another variable to add up to take care of the missing values. I have the full questionnaire so I'll be looking for other variables to combine with my original wage variable.
        Again thank you very much for your help!

        Comment


        • #5
          I have a similar problem, but with interactions. I have panel data of companies that have been targeted by journalists. For one of my interaction terms (journalist experience), I have all missing data for companies that have never been targeted by a journalist (target = 0). This makes sense as there is no associated journalist to measure experience for the non-targeted companies (target = 0). Running xtlogit, I get from Stata: "outcome does not vary; remember: 0 = negative outcome, all other nonmissing values = positive outcome." Does it make sense that I fill in zeroes for the variable journalist experience for all non-targeted companies and re-run the interaction?

          Comment

          Working...
          X