# Coding “Don't know” in Stata

I am coding a questionnaire on STATA and there is a question about Father Education with the option "Don't know" at the end. I am not sure how to code it, because I don't want to count it as missing variable, since the students that answer the questionnaire might have been raised by single moms, etc, and the "don't know" is a valid answer.

I am wondering if I should code it close to "No Education" as follow:

    recode father_educ2 (3=0 "No schooling")(11=1 "Don't Know")(4=2 "Elementary") ///
(5=3 "Middle_School")(6=4 "High_School Incomplete")(7=5 "High_School Graduate") ///
(8=6 "Some College")(9=7 "Bachelor Degree")(10=8 "Graduate Degree") ///
(1 2 12 13=. "Missing data"), gen(father_educ)


or should I include it after Graduate Degree? any thoughts?

Thanks anyone!

-
Because you can always recode values, why is this an issue? Use any codes you like but be sure to distinguish no answer from "don't know" so that you don't lose this fundamental distinction. Is your question perhaps really about coding for some particular analysis? If so, what analysis are you contemplating? –  whuber Jul 4 '12 at 18:40
Side comment: don't yell STATA, just say Stata. –  StasK Jul 5 '12 at 15:48

Extending on @whuber's comments, I would code this as an extended missing value:

    recode ... (12 = .d "Don't know") (13 = .r "Refused") ///
(1 = .n "Not applicable") (2 = .s "Skipped") ...


or something like that. These extended labeled missing values would show up properly in tabulate ..., missing, but would be appropriately excluded from say ordinal logistic regression with father's education as a dependent variable. As far as including these categories in the regression as an explanatory variable, I would probably try to come up with some three-four categories, like "Less than high school", "High school or equivalent", "Some college", "College", "Graduate/professional", may be combining some of these so that you have reasonable 10+% of the data in each category. The missing data, which is probably a small percentage, may go into a separate "Other" category, or, realistically speaking, combined with "Less than high school", because that's what this is likely going to be (at least if you are talking about the US, which you seem to do).

-
If you have a lot of data, why would you recommend combining categories? –  Michael Bishop Jul 6 '12 at 2:13
Define a lot. Typical studies where one would have to recode the values themeselves would be the data you collected yourself or shared be colleague that would have a thousand or so cases, so you would have 8 or so cases who would endorse "Middle school". The data sets coming from large scale national surveys would very likely have larger sample sizes, and much better meta data and formatting routines already in place. –  StasK Jul 6 '12 at 13:45
Fair enough, though I've worked with big datasets where I do have to make these decisions. New question: if you're going to combine categories, and this isn't your predictor of primary interest, would you combine "blindly" on theory alone or "cheat" by examining which which category its most similar to in its effect on the dependent variable. I take for granted that you should report what you did honestly, and that "cheating" would be wrong if the variable were one of great substantive interest. –  Michael Bishop Jul 6 '12 at 18:10

It depends on what analysis you want to do, but most likely you should code it as missing, since it is indeed missing. There is a true value of the variable for each such observation, and you do not observe that value. You observe that the student themselves do not know it either, but that information is probably irrelevant to whatever analysis you want to do (e.g., a wage regression).

If your goal was to understand how much students knew about their estranged fathers, then I would create a new binary variable, corresponding to each question about their father, which indicated whether the student knew the answer or not. But probably that's not what you have in mind.

-
Thank you for your response!!! I am looking at bullying in the school environment, and I would hate to exclude single-mom kids that simply "don't know" their father's level of education....especially because a lot of them are victims of bullying. Any more thoughts? Is it acceptable to use the mean for these cases, so I won't throw away their answers to other questions? –  Aibur Jul 3 '12 at 23:53
A missing value means no definite answer was obtained. "Don't know" potentially says a lot about the respondent: it could be related to absentee fathers or non-communicative parents. So coding "don't know" as a missing value looks like a mistake, potentially a serious one. Some fundamental rules of data collection: (1) Don't try to process the data while recording it. (2) Record exactly what is observed. –  whuber Jul 4 '12 at 18:44
Agreed with @whuber. For some reason I was assuming you already had a raw dataset and were simply preparing it for analysis. Definitely do not throw away information when creating the raw data. –  Aelmore Jul 4 '12 at 19:10