Hi Stata folks, some of my variables have values in which the respondents said "don't know". I'm running a regression where I want to exclude cases in which the respondents said "don't know". I know I could just do drop if "variable" == "don't know" but I'd like to save time and just ask the regression command to exclude such cases as it does to missing values. So here's a shot at what I'm trying to do:
probit q25c i.q101 q91 q6b if democracy == 0 || drop if any observation == "don't know"
The "if democracy ==0" command is just to limit the sample to non-democracies.
probit q25c i.q101 q91 q6b if democracy == 0 || drop if any observation == "don't know"
The "if democracy ==0" command is just to limit the sample to non-democracies.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(q6b q25a q91 q101) float(Idmission50 democracy) 3 0 . 1 1 1 4 1 . 2 1 1 3 1 . 2 1 1 2 0 . 2 1 1 1 0 . 1 1 1 4 0 . 1 1 1 3 0 . 2 1 1 4 0 . 2 1 1 3 0 . 1 1 1 4 0 4 2 1 1 4 0 . 1 1 1 2 2 . 2 1 1 4 0 4 1 1 1 2 0 3 2 1 1 2 2 . 2 1 1 4 0 . 1 1 1 3 0 4 2 1 1 4 2 . 1 1 1 1 0 . 1 1 1 2 0 . 2 1 1 3 0 . 2 1 1 9 2 . 1 1 1 3 1 . 2 1 1 3 0 . 1 1 1 3 0 . 2 1 1 4 0 3 2 1 1 4 0 3 2 1 1 3 0 . 2 1 1 5 0 . 1 1 1 1 0 4 2 1 1 4 0 3 2 1 1 5 2 4 1 1 1 1 0 4 2 1 1 3 0 3 2 1 1 3 1 . 2 1 1 2 0 4 2 1 1 3 0 . 1 1 1 3 0 . 2 1 1 2 0 . 1 1 1 3 0 . 1 1 1 3 2 . 1 1 1 4 1 . 1 1 1 3 0 . 2 1 1 3 2 . 1 1 1 3 0 4 2 1 1 3 0 . 2 1 1 2 0 . 1 1 1 4 0 3 1 1 1 4 2 . 1 1 1 3 0 . 2 1 1 4 0 3 1 1 1 4 0 . 2 1 1 4 0 . 2 1 1 3 0 . 2 1 1 3 0 . 1 1 1 3 0 . 2 1 1 3 2 1 2 1 1 2 2 . 1 1 1 2 2 . 1 1 1 4 2 3 1 1 1 3 1 . 2 1 1 3 1 . 1 1 1 3 0 . 2 1 1 3 1 1 1 1 1 4 1 3 1 1 1 3 1 . 1 1 1 4 0 . 2 1 1 2 0 4 1 1 1 4 0 1 1 1 1 4 0 4 1 1 1 2 0 4 2 1 1 3 1 . 1 1 1 4 0 4 1 1 1 4 0 4 2 1 1 3 0 4 1 1 1 3 0 4 2 1 1 4 0 4 1 1 1 4 2 . 1 1 1 3 0 . 2 1 1 3 1 . 2 1 1 4 0 . 1 1 1 4 0 . 1 1 1 3 2 . 1 1 1 3 0 . 1 1 1 2 0 4 2 1 1 3 0 1 1 1 1 4 1 . 2 1 1 4 0 3 1 1 1 3 0 1 1 1 1 4 1 . 1 1 0 3 0 . 1 1 0 2 0 . 2 0 0 2 0 . 1 0 0 3 0 . 2 0 0 3 3 4 2 0 0 2 1 . 2 0 0 4 0 4 1 0 0 3 0 . 2 0 0 4 0 4 2 1 0 3 3 1 1 1 0 end label values q6b LABI label def LABI 1 "much worse", modify label def LABI 2 "worse", modify label def LABI 3 "same", modify label def LABI 4 "better", modify label def LABI 5 "much better", modify label def LABI 9 "don't know", modify label values q25a LABP label def LABP 0 "never", modify label def LABP 1 "only once", modify label def LABP 2 "a few times", modify label def LABP 3 "often", modify label values q91 q91 label def q91 1 "not at all important", modify label def q91 3 "somewhat important", modify label def q91 4 "very important", modify label values q101 LABAR label def LABAR 1 "male", modify label def LABAR 2 "female", modify
Comment