Question

Status:Closed    Asked:Apr 25, 2018 - 09:19 AM

Why will be logistic regression not work after I drop the NIU values in my variable?

I am doing a research project for my quantitative analysis class and I am using a logistic regression in STATA to determine if education attainment has an effect on if someone revied any flu vaccine in the past 12 months. I was informed by my professor that the logistic regression would be a correct test to run on my data and that not using the NIU values would be the right choice, but I can not get the logistic regression to work when NIU is removed. The error I get in STATA is :



. logistic vacflu12m educrec2
outcome does not vary; remember:
0 = negative outcome,
all other nonmissing values = positive outcome
r(2000);

 
Do you have the same question? Follow this Question
 

Staff Answer

avatar

Jeff Bloem

Staff

In order for a logistic regression to function properly, your dependent variable (in your case the variable indicating flue vaccination in the past 12 months) needs to be a binary 0/1 variable. Importantly, the codes for VACFLU12M are not simply 0 or 1. VACFLU12M==1 is No, ==2 is Yes, ==3 is both shot and spray (up to the 2015 sample only), ==7 is Refused, ==8 is Not ascertained, and ==9 is Don't know. You will need to re-code these variables before you run your logistic regression. The same idea applies to EDUCREC2. Other than ==00 NIU, other codes you'll need to clean up are ==96 Not reported, ==97 Refused, ==98 Not ascertained, and 99 Unknown.

 

Apr 25, 2018 - 11:49 AM

1
0
Report it

OTHER QUESTIONS NEEDING ANSWERS

negative values of wtsupp 1975 and before
Hi there,I have problem getting some variables like Salary-Class, Country, Wo...
NHIS SDA Regression Question
data analysis in Stata
Login   |   Register

Recently Active Members

View More »

Share |