# Use categorical variable vs create dichotomous variable for each one?

I would like to know whether I should/shouldn't split a categorical variable into separate dummy variables for an OLS regression.

For example, I am regressing income on education using data from the Basic Feb 2016 data set from the U.S. Census Current Population Survey.

The dataset has a variable for highest level of education coded as follows:

-1 - not in universe
31 - Less than 1st grade
32 - 2nd, 3rd, or 4th grade
...
38 - 12th Grade No Diploma
39 - High School Grad-Diploma Or Equiv (GED)
40 - Some College But No Degree
41 - Associate Degree-Occupational/Vocational
42 - Associate Deg.-Academic Program
43 - Bachelor''s Degree(ex: BA, AB, BS)
44 - MASTER''S DEGREE(ex: MA, MS, MEng, MEd, MSW)
45 - Professional School Deg(ex: MD, DDS, DVM)
46 - DOCTORATE DEGREE(ex: PhD,EdD)


In my regression I would use an indicator variable to represent each group, and I would drop one group.

But, I could also make a dichotomous variable for each group and include each one in the regression. This sort of makes sense because a person can have a PhD and not a Masters.

Which should I do and why? Are there other variables where it should be different?

## 3 Answers

To add to what Aksakal mentioned in the answer above:

1. "Dummy variable," and "indicator variable," both refer to the same thing†
2. When you enter dummy variables into a regression model, you need to drop one group to serve as the reference category. The reason you need to drop one group is because you will get perfect collinearity if you don't. Some statistical packages will automatically drop one variable from your model in the event of perfect collinearity.
3. In reality, you may want to collapse some of the groups in your analysis, because having all of the categories in there may not be meaningful. For example, if your reference group is "less than first grade," someone who has a 2nd, 3rd, or 4th grade education is probably not going to be that much different from someone with less than first grade education in the grand scheme of things (OK, the person may be able to read and do maths better, but how much difference would that really translate to?).
4. Be careful with your interpretation. You mentioned above that "But, I could also make a dichotomous variable for each group and include each one in the regression. This sort of makes sense because a person can have a PhD and not a Masters." I took a quick look at the CPS survey instrument on the U.S. Census website. Based on the way the education question was asked, you cannot interpret including the "Doctorate degree" dummy variable as "a person can have a PhD and not a Masters," because that's not what the question is intended to capture. It simply asks the highest level of education, so some of the people who have doctorates in your sample also have master's degrees. The question does not distinguish those with multiple advanced degrees vs. those with single degrees.
5. Make sure you control for age if you're using Census data. A 16 year old person who is still in high school in 11th grade is probably going to have different income from a 32 year old person who only has an 11th grade education and did not complete high school or have a GED.

†For point #1, I originally had included "dichotomous variable" and "binary variable" in the list. User ttnphns commented in my original post and correctly pointed out that I was sloppy in lumping these two types of variables with dummy and indicator variables. Dummy and indicator variables are special cases of dichotomous/binary variables in which the alternatives are coded as 0 or 1. Of course, dichotomous and binary variables can have other coding besides 0/1, 1/2 is a popular alternative coding scheme, and I have seen 1/3 used in my datasets. I have edited my post to remove "dichotomous variable" and "binary variable" from the list.

• But you can drop the intercept and the model will estimate all levels of the categorical features. – Mike Hunter Apr 4 '16 at 19:04
• @DJohnson, good point, although the OP should really understand what they're doing when they fit a no-intercept model :) – Marquis de Carabas Apr 4 '16 at 19:15
• "Dichotomous variable," "binary variable," "dummy variable," and "indicator variable" all refer to the same thing. Not quite so. Not every binary variable is dummy (indicator). We usually call dummy only those variables coming from single-response, alternative-choice categorical question/variable. – ttnphns Apr 4 '16 at 20:44
• I stand corrected, I was being sloppy in my terminology. I just remembered a dataset I had where all the "yes" responses were coded as 1 and "no" responses coded as 3. I just recode them all to 0/1 on autopilot – Marquis de Carabas Apr 4 '16 at 20:45

It's the same thing what you call dichotomous and indicator (dummy) variable. In both cases you have to drop one category.

In your case there is a natural base category:

-1 - not in universe

What you have is an ordinal and not just a categorical variable. You can encode it as binaries but probably will lose important information. The one you have has an integer equivalent - years in school. Maybe you'll get better results if you encode it as continuos based on this number.

• It's hard to argue that 41-42 and 44-46 are ordinal. Is MD higher than MS? – Aksakal Apr 4 '16 at 20:15
• I agree with @Aksakal. You may also have people with multiple degrees. Beyond high school, you can't use # years of schooling as a meaningful measure. I could have got 4 associates degrees in 8 years, or I could have a bachelor's degree and an MD in ~ the same amount of time. You might even start seeing negative returns to education once you get in the very high # of years of education bracket (inside joke X-D). An entry-level humanities professor at a public university and a neurosurgeon resident (both with at least 10 yrs of education post-bac) make around \$65k, depending on location... – Marquis de Carabas Apr 4 '16 at 20:43
• @Aksakal, I do not know, but we don't have to argue, the OP should know that. I guess this way or another the ultimate decision is on whether ordinal approach gives the model a better predictive power. It would not be wise to throw that information right away though. – Diego Apr 5 '16 at 14:28