Skip to content

Lesson M05.L03: Dummy Variables

Field Detail
Module 05 — Functional Forms & Dummy Variables
Level Graduate
Duration 30–35 min
Learning Objective Construct and interpret binary dummy variables; understand the intercept-shift interpretation; correctly encode multi-category variables using G−1 dummies; interpret the base category.
Provenance Wooldridge Introductory Econometrics, Ch 7.1–7.2

Explanation

What Is a Dummy Variable?

A dummy variable (also called an indicator variable or binary variable) takes only two values:

\[D_i = \begin{cases} 1 & \text{if observation } i \text{ belongs to the group of interest} \\ 0 & \text{otherwise} \end{cases}\]

Dummy variables allow us to include qualitative information — gender, region, marital status, industry, treatment status — as regressors in a linear regression model.


Regression with a Single Dummy

Consider the model:

\[y_i = \beta_0 + \beta_1 D_i + \beta_2 x_i + u_i\]

Interpretation of \(\beta_1\):

The conditional expected value of \(y\) for each group:

\[E[y_i \mid D_i = 1, x_i] = (\beta_0 + \beta_1) + \beta_2 x_i$$ $$E[y_i \mid D_i = 0, x_i] = \beta_0 + \beta_2 x_i\]

The difference:

\[E[y_i \mid D_i = 1, x_i] - E[y_i \mid D_i = 0, x_i] = \beta_1\]

\(\hat{\beta}_1\) estimates the difference in the mean of \(y\) between the \(D=1\) group and the \(D=0\) group, controlling for \(x\).

This is an intercept shift: both groups share the same slope \(\beta_2\) (parallel regression lines), but the group with \(D=1\) has its regression line shifted up (or down) by \(\beta_1\).


The Base/Reference Category

The group with \(D = 0\) is called the base category or reference group. All dummy coefficients are interpreted relative to this base.

Choosing the base category is a matter of convenience and interpretability — there is no statistical reason to prefer one choice over another, though the one with the largest sample size or the most natural comparison point is often chosen.


Multiple Dummies from One Categorical Variable

Suppose a categorical variable has \(G\) mutually exclusive groups (e.g. \(G = 4\) geographic regions: North, South, East, West). You need \(G - 1\) dummy variables, omitting one group as the base.

\[y_i = \beta_0 + \beta_1 D_{North,i} + \beta_2 D_{South,i} + \beta_3 D_{East,i} + \beta_4 x_i + u_i\]

Here West is the omitted base region. Interpretations:

  • \(\hat{\beta}_1\): estimated difference in mean \(y\) between North and West, controlling for \(x\)
  • \(\hat{\beta}_2\): estimated difference in mean \(y\) between South and West, controlling for \(x\)
  • \(\hat{\beta}_3\): estimated difference in mean \(y\) between East and West, controlling for \(x\)

The intercept \(\hat{\beta}_0\) is the predicted value of \(y\) for the West group when \(x = 0\).

Why \(G-1\) and not \(G\)? Including all \(G\) dummies creates perfect multicollinearity (the dummy variable trap — see Lesson M05.L04). OLS cannot be computed with all \(G\) dummies included alongside an intercept.


Example: Gender Wage Gap

Model:

\[\log(wage_i) = \beta_0 + \beta_1\, female_i + \beta_2\, educ_i + \beta_3\, exper_i + u_i\]

Estimated:

\[\log(\widehat{wage_i}) = 0.417 - 0.297\, female_i + 0.080\, educ_i + 0.029\, exper_i\]

Interpretation:

\(\hat{\beta}_1 = -0.297\): Holding education and experience constant, female workers earn approximately \(100 \times 0.297 = 29.7\%\) less than male workers. (Exact: \(100(e^{-0.297}-1) \approx -25.7\%\).)

This is the conditional gender gap — the portion that remains after controlling for education and experience. It does not capture the full unconditional gap, nor does it explain why the gap exists.


Worked Example

Dataset: Wooldridge WAGE1, \(n = 526\).

Step 1 — Create dummy variable: \(female_i = 1\) if worker is female, 0 if male.

Step 2 — Estimate model:

\[\log(\widehat{wage_i}) = 0.417 - 0.297\, female_i + 0.080\, educ_i + 0.029\, exper_i\]
Variable Coefficient SE t-stat
Intercept 0.417 0.099 4.21
female −0.297 0.036 −8.25
educ 0.080 0.007 11.43
exper 0.029 0.005 5.80

\(R^2 = 0.364\), \(n = 526\)

Step 3 — Interpret:

  • The coefficient on \(female\) is statistically significant (\(t = -8.25\), very far from zero).
  • The parallel-lines interpretation: male and female log-wage profiles are parallel (same returns to education and experience), but the female line lies 0.297 units below the male line.
  • The intercept 0.417 is the predicted \(\log(wage)\) for a male worker with zero education and zero experience — not economically meaningful but mathematically well-defined.

Common Misconception

"The intercept is the mean of \(y\) for the base group."

Correction: The intercept \(\hat{\beta}_0\) is the predicted value of \(y\) for the base group when all continuous regressors equal zero. This is rarely the mean of \(y\) for the base group, and it may not even be a meaningful quantity (no worker has zero education and zero experience). The mean of \(y\) for the base group is estimated by evaluating the regression at the mean values of the continuous regressors, not at zero. To get the predicted \(y\) for the base group at meaningful covariate values, plug in specific \(x\) values:

\[\hat{y}_{base} = \hat{\beta}_0 + \hat{\beta}_2 \bar{x}\]

Practice Prompts

Prompt 1 — Interpretation A researcher estimates:

\[\widehat{health} = 3.8 + 0.6\, married + 0.15\, age - 0.12\, smoke\]

where \(health\) is a self-reported health score (1–5), \(married \in \{0,1\}\), \(age\) is in years, and \(smoke \in \{0,1\}\) indicates daily smoking.

(a) Interpret the coefficient on \(married\). (b) Who is the base category when both \(married\) and \(smoke\) are included? (c) What is the predicted health score for a 40-year-old married non-smoker?


Prompt 2 — Multi-category dummies A dataset contains workers classified into four industries: Manufacturing, Services, Finance, and Agriculture (the base). Dummies are created for Manufacturing, Services, and Finance.

(a) How would you interpret the coefficient on the Manufacturing dummy? (b) A student wants to test whether Manufacturing and Services workers earn the same average wage (controlling for other factors). How would you set up this test? (c) What would happen if the researcher also included an Agriculture dummy?


Prompt 3 — Parallel slopes Explain in your own words what the "parallel regression lines" interpretation of a dummy variable means. Under what circumstances would you expect this assumption to be violated, and how would you modify the model to allow for non-parallel lines?


Further Resources

  • Wooldridge, Introductory Econometrics (7th ed.), §7.1–7.2
  • Stata: gen female = (sex == 2) then reg lwage female educ exper
  • R: wage1$female <- as.numeric(wage1$female) then lm(log(wage) ~ female + educ + exper, data = wage1)
  • For factor variables in R: lm(log(wage) ~ factor(industry) + educ, data = d) — R automatically drops one category