Hello, I am trying to run a logistic regression in stata. I have stata 17. I'm using the 'logit' command and then 4 independent variables (all of them are categorical variables). I also use two 'if-commands', one limiting the age to an age group (the variable is categorized) and one if e(sample). I recoded my dependent variable into a basic dummy variable. However, I keep getting the 'no observation' error. My database i quite large. The dependent variable has over 6800 observations. I tried to check if my if-command is too restrictive, but that does not seem to be the case, because even when leaving out all if-command, stata tells me that there are no observations. Thank you in advance for any advice.
This is what i type into stata:
cap drop AfD
recode s7 1=0 2=0 3=0 4=0 5=0 6=1 7=0 8=. 9=. 10=., gen(AfD)
logit AfD i.region i.gender i.education i.houseincome if age == 1 & e(sample)
no observations
r(2000);
This is what i type into stata:
cap drop AfD
recode s7 1=0 2=0 3=0 4=0 5=0 6=1 7=0 8=. 9=. 10=., gen(AfD)
logit AfD i.region i.gender i.education i.houseincome if age == 1 & e(sample)
no observations
r(2000);
Comment