Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics and Econometrics book
Econometrics guide, Unit 2, step 9 of 20Previous stepNext step

Step 9: Dummy Variables and the Chow Test

Course matchIntroductory econometrics: qualitative information, interactions and structural change · Wooldridge Ch. 7 · Stock & Watson Ch. 8
In 30 seconds
  • A dummy variable equals 1 if an observation has a characteristic and 0 if not. A single dummy shifts the intercept: its coefficient is the difference from the base group, holding the other regressors fixed.
  • When \( y \) is in logs, a dummy coefficient \( \delta \) means a difference of exactly \( 100(e^{\delta}-1) \)%. In the book’s wage data the gender gap of −0.1578 is −14.6%, not −15.8%.
  • A variable with \( g \) categories needs \( g-1 \) dummies. Including all \( g \) with an intercept is the dummy-variable trap (perfect collinearity).
  • Interacting a dummy with a continuous variable gives each group its own slope. The Chow test asks whether a whole regression differs between two groups or two periods.
  • Exam point: say where a Chow test finds the difference (intercept, slopes or both), not just whether it rejects.
Video lesson coming soonA short animated lesson for this step will appear here.
What you will learn
  • How to code qualitative information as 0/1 dummies and read a dummy coefficient as an intercept shift.
  • How to convert a dummy coefficient into an exact percentage when \( y \) is in logs.
  • How to handle several categories, choose a base and avoid the dummy-variable trap, and when to treat an ordinal variable as dummies.
  • How to interpret interactions between two dummies and between a dummy and a continuous variable.
  • How to run the Chow test in both forms, test for a structural break, and recognise the linear probability model.

Turning categories into numbers

Many things economists care about are not numbers. A worker is a man or a woman, a union member or not, lives in one of four regions. A house has a pool or it does not. A quarter falls before or after a policy change. To use such information in a regression, you turn it into variables that equal 0 or 1.

Key termA dummy variable (binary, indicator or zero–one variable) equals 1 if an observation has a given characteristic and 0 if it does not. The group coded 0 is the base group (or reference group). The coefficient on a dummy is always a difference relative to the base group, holding the other regressors fixed.
Econometrics Made Simple textbook coverChapter 9 of Econometrics Made Simple covers this in full: dummy variables, interactions, the Chow test, structural breaks and the linear probability model, with Python, R and Stata code.Get the textbook · $15

Three conventions keep dummies easy to read. Name the dummy after the category coded 1: female, not gender. Code it 0 and 1, never 1 and 2; recode survey data before you run anything. Use the mean as a check: the mean of a dummy is a proportion. In wages.csv the mean of female is 0.514, so 51.4% of the sample are women.

Common mistakeEntering a categorical variable stored as numbers, such as region coded 1 = East, 2 = North, 3 = South, 4 = West, as a single regressor. That assumes moving from East to North has the same effect as moving from North to South. The numbers are only labels. Always turn such a variable into dummies.

One dummy: shifting the intercept

Add the dummy female to a regression of log wage on education:

\[ \log(\text{wage}) = \beta_0 + \delta_0\,\text{female} + \beta_1\,\text{educ} + u. \]

For men the intercept is \( \beta_0 \); for women it is \( \beta_0 + \delta_0 \). The slope on education is the same for both. A single dummy shifts the line up or down without changing its slope, so the gap is the same at every level of education. With no other regressors, the regression of \( y \) on a dummy simply gives the two group means: the intercept is the base-group mean and the coefficient is the difference in means.

Worked example

Chapter 9 of Econometrics Made Simple estimates the gender gap on the 1,000 workers in wages.csv. Alone, the female coefficient is −0.1582 (se 0.0321). With education, experience and tenure added:

\[ \widehat{\log(\text{wage})} = 1.5285 – 0.1578\,\text{female} + 0.1053\,\text{educ} + 0.0057\,\text{exper} + 0.0158\,\text{tenure}, \quad R^2 = 0.233. \]
Step 1The raw gap −0.1582 equals the difference in mean log wages, \( 2.8071 – 2.9653 \).
Step 2Exact gap with controls: \( 100(e^{-0.1578}-1) = -14.60\% \). Women earn about 14.6% less than men with the same education, experience and tenure.
Step 3Measured from women’s wages, men earn \( 100(e^{0.1578}-1) = 17.10\% \) more. Both are right; say which base you use.

The gap hardly moves when controls are added because men and women in this sample barely differ in them: average schooling is 11.61 years for men and 11.67 for women, and average experience 17.64 and 17.70. By the omitted variable bias formula of Step 6, controls that do not differ between groups cannot explain a gap between them. The standard error does fall, from 0.0321 to 0.0286, because the controls remove noise.

\[ \text{In } \log y = \beta_0 + \delta D + \cdots + u, \text{ the group with } D = 1 \text{ has } y \text{ higher by exactly } 100\,(e^{\delta}-1)\%. \]

A dummy cannot change by a small amount; it jumps from 0 to 1. So the approximation \( 100\delta \) from Step 8 is close only when \( |\delta| \) is below about 0.1. Our post Dummy Variables has further worked examples.

Several categories and the dummy-variable trap

A variable with \( g \) categories needs \( g-1 \) dummies in a regression with an intercept. The category left out is the base. With region and East as the base:

\[ \log(\text{wage}) = \beta_0 + \delta_1\,\text{North} + \delta_2\,\text{South} + \delta_3\,\text{West} + \beta_1\,\text{female} + \cdots + u. \]

Why not all four? Because East + North + South + West = 1 for every worker, and the intercept is also a column of ones. The intercept is then an exact linear combination of the dummies, which breaks MLR.3. Adding any constant to \( \beta_0 \) and subtracting it from every \( \delta \) gives the same fitted values, so OLS has no unique answer. This is the dummy-variable trap. Software drops one category for you.

Worked example

With East as the base, the region coefficients are North 0.0239, South −0.1076 and West −0.0193 (controls: female, educ, exper, tenure). Find the South–North difference as an exact percentage, and say whether regions matter.

Step 1South − North: \( -0.1076 – 0.0239 = -0.1315 \). Exactly, \( 100(e^{-0.1315}-1) = -12.32\% \).
Step 2Re-estimating with South as the base gives North \( +0.1315 \), with se 0.0370, so \( t = 3.55 \). The fitted values and \( R^2 = 0.2442 \) are identical in both versions.
Step 3Individual \( t \) tests depend on the base. The right test is the joint \( F \) test of Step 7: \( F = 4.880 \), \( p = 0.0023 \).

Regions differ, mainly because the South pays less than the other three. Changing the base relabels the comparisons; it does not change the model.

Exam tipChoose a base that makes the comparisons you care about direct: the largest group, the “normal” case, or the period before a policy. Then name it in every table (“base: East”). A dummy coefficient means nothing until the reader knows what it is compared with.

Ordinal variables: one number or dummies?

An ordinal variable has a natural order but no natural scale: a credit rating, a satisfaction score, a level of education. Entering it as one number (1, 2, 3, 4) forces equal steps. Dummies let every step differ. The book groups schooling into four levels. As one number, each level adds 0.2216 to log wage. As dummies, the steps are 0.2840, 0.1415 and 0.3104, far from equal. The numeric model is a restricted version of the dummy model (two restrictions), and the \( F \) test gives \( F = 3.288 \), \( p = 0.038 \): the equal-steps restriction is rejected at 5%.

Econometrics Made Simple Practice Questions coverDummy interpretation and Chow tests appear in nearly every econometrics paper. The Practice Questions book has over 1,150 questions, every one with a worked answer.Get 1,150+ questions · $9

Interactions with dummies

Two dummies: four groups

Adding female × married lets the marriage premium differ by sex. The product is 1 only for married women. The book’s estimates (controls: educ, exper, tenure) give four group intercepts:

GroupInterceptDifference from single men
Single men (base)\( \beta_0 \)—
Married men\( \beta_0 + \delta_2 \)+0.0376 (+3.83%)
Single women\( \beta_0 + \delta_1 \)−0.1847 (−16.86%)
Married women\( \beta_0 + \delta_1 + \delta_2 + \delta_3 \)−0.0656 (−6.35%)

\( \hat\delta_1 = -0.1847 \) is the gender gap among single workers; \( \hat\delta_2 = 0.0376 \) the marriage premium for men; and the interaction \( \hat\delta_3 = 0.0815 \) is how much larger the premium is for women (0.1191 in total). Its \( t = 1.36 \), so the data cannot reject equal premiums.

A dummy and a continuous variable: different slopes

\[ \log(\text{wage}) = \beta_0 + \delta_0\,\text{female} + \beta_1\,\text{educ} + \delta_1\,\text{female}\times\text{educ} + \cdots + u. \]

For men the slope on education is \( \beta_1 \); for women it is \( \beta_1 + \delta_1 \). The gap between the groups at any education level is \( \delta_0 + \delta_1\,\text{educ} \).

Worked example

The estimates are \( \hat\delta_0 = 0.0715 \) (\( t = 0.40 \)), \( \hat\beta_1 = 0.1150 \) and \( \hat\delta_1 = -0.0197 \) (\( t = -1.29 \)). Interpret them and find the gap at the mean education of 11.64 years.

Step 1Return to education: 0.1150 for men, \( 0.1150 – 0.0197 = 0.0953 \) for women. But \( p = 0.198 \) on the interaction, so equal returns cannot be rejected.
Step 2+0.0715 is the gap at educ = 0. Nobody has fewer than 8 years of schooling, so it is not a finding that women earn more.
Step 3At 11.64 years: \( 0.0715 – 0.0197 \times 11.64 = -0.158 \), the same gap as before.

Centring educ at its mean makes the female coefficient equal this gap directly (−0.1579, se 0.0286).

Common mistakeDropping the main effect and keeping only the interaction, as in \( \beta_0 + \beta_1\text{educ} + \delta_1\text{female}\times\text{educ} \). This forces the same intercept for both groups, so the interaction picks up the intercept difference. Keep the main effects whenever you include an interaction.

The Chow test: is the whole regression the same?

Do urban and rural workers need separate wage equations? With \( k \) regressors, the null hypothesis is that all \( k+1 \) parameters (intercept included) are equal across the two groups.

\[ F = \frac{\big[\text{SSR}_P – (\text{SSR}_1 + \text{SSR}_2)\big]/(k+1)}{(\text{SSR}_1 + \text{SSR}_2)/\big[n – 2(k+1)\big]} \;\sim\; F_{k+1,\;n-2(k+1)}. \]

\( \text{SSR}_P \) comes from the pooled regression and \( \text{SSR}_1, \text{SSR}_2 \) from separate regressions for each group. Equivalently, interact the group dummy with every regressor and test all the dummy terms jointly. The fully interacted model has SSR equal to \( \text{SSR}_1 + \text{SSR}_2 \), so the two versions give the same \( F \).

Worked example

For \( \log(\text{wage}) = \beta_0 + \beta_1\,\text{educ} + u \) (\( k = 1 \), \( n = 1{,}000 \)): \( \text{SSR}_P = 227.1837 \), urban \( \text{SSR}_1 = 146.1430 \), rural \( \text{SSR}_2 = 78.6958 \). Carry out the Chow test.

Step 1\( \text{SSR}_1 + \text{SSR}_2 = 224.8388 \); restrictions \( k+1 = 2 \); df \( = 1000 – 4 = 996 \).
Step 2\( F = \dfrac{(227.1837 – 224.8388)/2}{224.8388/996} = \dfrac{1.1725}{0.22574} = 5.19 \), \( p = 0.0057 \).
Step 3The 1% critical value of \( F_{2,996} \) is 4.63: reject a common equation.
Step 4Where is the difference? The interaction urban × educ is −0.0077 (\( t = -0.455 \)): the slopes are the same. At mean education the urban gap is \( 0.1896 – 0.0077 \times 11.64 = 0.100 \), about 10.5% more pay.

The return to schooling is the same in towns and the countryside; the level of pay is not. A single urban dummy with a common slope describes these data well.

Two refinements. To test only the slopes, keep the dummy in both models and test the interaction terms. And the classic Chow test assumes equal error variances in the two groups; a heteroskedasticity-robust version (Step 11) gives \( F = 5.50 \), \( p = 0.004 \) here, so the conclusion stands.

Structural breaks: the Phillips curve

The same tools ask whether a relationship changed at a date. A break dummy equals 0 before the break and 1 from it. Alone it shifts the intercept; interacted with a regressor it changes the slope. Using real US quarterly data, the book defines post = 1 from 1970 and estimates

\[ \text{infl}_t = \beta_0 + \delta_0\,\text{post}_t + \beta_1\,\text{unemp}_t + \delta_1\,\text{post}_t \times \text{unemp}_t + u_t. \]

One regression over 1959–2009 finds nothing: slope +0.145, \( t = 0.92 \). With the break, the slope before 1970 is −1.357 (\( t = -3.02 \)), a clear trade-off; from 1970 it is \( -1.3571 + 1.4755 = 0.118 \), no trade-off at all. The test of \( \delta_0 = \delta_1 = 0 \) gives \( F = 11.08 \), \( p < 0.001 \). At 5% unemployment, predicted inflation is 2.23% before 1970 and 4.24% after.

US inflation against unemployment, 1959–2009 % per year
1959–1969 (44 quarters)1970–2009 (159 quarters)one line for all quarters
34567891011-10-5051015unemployment rate (%)inflation (%)before 1970: slope −1.36from 1970: slope 0.12
Figure 1. Quarterly US data (us_macro.csv, from the BEA and BLS via statsmodels). Before 1970 higher unemployment went with lower inflation; from 1970 the relationship is flat. The single dashed line through all 203 quarters (slope 0.145) describes neither period. The break test gives F = 11.08, p < 0.001. Econometrics Made Simple, Chapter 9.
Common mistakeTrusting a break test’s \( p \)-value without two caveats. Time-series errors are usually autocorrelated, which makes ordinary \( F \) tests too willing to find effects (Step 12). And a break date chosen after looking at a plot biases the test towards finding a break. A date fixed in advance by a known event is far more convincing.

Dummies on the left: a preview

If the outcome itself is 0 or 1, OLS gives the linear probability model (LPM): each coefficient is a change in the probability that \( y = 1 \), in percentage points. In the book’s loan data, 100 more points of credit score raise the approval probability by 22.1 points. The LPM is easy to read but can predict probabilities above 1 (155 applicants here) and always needs robust standard errors. Step 14 introduces logit and probit; see also Logit vs Probit.

A treatment dummy marks who received a policy. Its coefficient is a causal effect only if treatment was as good as random. In the book’s minimum-wage data, comparing the two states after the rise gives 1.21 FTE, but they already differed before. Combining a treatment dummy, a period dummy and their interaction gives the difference-in-differences estimate, 2.75, close to the true 2.6. Step 16 develops this; for a full worked example read Difference-in-Differences (DiD) Explained.

Practise: 6 questions

Try each one on paper first, then check the worked answer.

EasyQ1. A regression of hourly pay ($) gives \( \widehat{\text{wage}} = 8.5 + 1.2\,\text{educ} – 2.1\,\text{female} \). Interpret −2.1, and predict the wage of a woman with 12 years of education. Show worked answer
Holding education fixed, women earn on average $2.10 an hour less than men (the base group).
Prediction: \( 8.5 + 1.2(12) – 2.1 = 8.5 + 14.4 – 2.1 = 20.8 \), so $20.80 an hour.
EasyQ2. Quarterly sales are regressed on price and a set of season dummies, with an intercept. How many season dummies should you include, and what does each coefficient measure? Show worked answer
Four seasons, so three dummies; the omitted season is the base.
Including all four with the intercept is the dummy-variable trap: the four dummies sum to 1, the same as the intercept column.
Each coefficient is the expected difference in sales between that season and the base season, holding price fixed.
MediumQ3. In a log-wage regression the coefficient on union is 0.22. Give the exact percentage union premium, and the exact percentage by which non-members earn less than comparable members. Show worked answer
Members relative to non-members: \( 100(e^{0.22}-1) = 24.61\% \) more.
Non-members relative to members: \( 100(e^{-0.22}-1) = -19.75\% \).
The two numbers differ because they use different bases. The approximation 22% is too far from either to use.
MediumQ4. \( \widehat{\log(\text{wage})} = 1.2 + 0.09\,\text{educ} + 0.30\,\text{urban} – 0.012\,\text{urban}\times\text{educ} \). Find the urban–rural gap at 10 and at 16 years of education, and the return to education for urban workers. Show worked answer
Gap: \( 0.30 – 0.012\,\text{educ} \).
At 10 years: \( 0.30 – 0.12 = 0.18 \), exactly \( 100(e^{0.18}-1) = 19.7\% \).
At 16 years: \( 0.30 – 0.192 = 0.108 \).
Urban return to education: \( 0.09 – 0.012 = 0.078 \), about 7.8% per year, against 9% for rural workers.
MediumQ5. A regression with \( k = 3 \) regressors is estimated on 300 firms. The pooled SSR is 520; separate regressions for manufacturing and services give SSRs of 240 and 250. Carry out the Chow test at 5% (critical value of \( F_{4,292} \): 2.40). Show worked answer
Restrictions: \( k+1 = 4 \). Denominator df: \( 300 – 2(4) = 292 \).
\( \text{SSR}_1 + \text{SSR}_2 = 490 \).
\( F = \dfrac{(520-490)/4}{490/292} = \dfrac{7.5}{1.678} = 4.47 \).
\( 4.47 > 2.40 \): reject. The two sectors need different equations; the interacted model would show whether the difference is in the intercept, the slopes or both.
ExamQ6. A log-wage model includes \( -0.12\,\text{female} + 0.06\,\text{married} – 0.05\,\text{female}\times\text{married} \), plus education and experience. (a) What is the gender gap among single workers? [1] (b) What is the marriage premium for women? [2] (c) Find the exact percentage wage difference between married women and single men. [2] (d) A student instead includes dummies for all four groups plus an intercept. Explain what goes wrong. [2] Show worked answer
(a) −0.12, about 11.3% lower exactly (\( 100(e^{-0.12}-1) \)), holding the controls fixed. [B1]
(b) For women: \( 0.06 + (-0.05) = 0.01 \) [M1], a premium of about 1%, against 6% for men. [A1]
(c) Married women vs single men: \( -0.12 + 0.06 – 0.05 = -0.11 \) [M1]; exactly \( 100(e^{-0.11}-1) = -10.4\% \). [A1]
(d) The four group dummies sum to 1 for every worker, the same as the intercept column: perfect collinearity, the dummy-variable trap. [B1] Drop one group (it becomes the base) or drop the intercept. [B1]
Total: 7 marks.

Check yourself

1. A model with an intercept includes a dummy for each of the 12 months. What is wrong?

The 12 dummies add up to 1, the same as the intercept: the dummy-variable trap. Use 11 and treat the omitted month as the base.

2. In a model with female, educ and female × educ, the coefficient on female is

With the interaction, the gap at any education level is \( \delta_0 + \delta_1\,\text{educ} \), so \( \delta_0 \) alone is the gap at zero schooling.

3. With \( k = 2 \) regressors and \( n = 500 \), the Chow test has how many restrictions?

All \( k+1 = 3 \) parameters, intercept included, are restricted to be equal across groups. The denominator df is \( 500 – 6 = 494 \).

Your score: 0 out of 3

The short version

  • A dummy equals 1 for one category and 0 otherwise. A single dummy shifts the intercept; its coefficient is the difference from the base group, holding other regressors fixed.
  • In a log model use \( 100(e^{\delta}-1) \): the wage gap of −0.1578 is −14.6%.
  • \( g \) categories need \( g-1 \) dummies. Changing the base changes coefficients and \( t \) statistics, not fitted values or \( R^2 \); test a categorical variable with a joint \( F \) test.
  • Dummy × dummy gives four group intercepts; dummy × continuous gives separate slopes, and the dummy’s own coefficient is the gap at \( x = 0 \).
  • The Chow test compares pooled and separate regressions, or tests all interactions jointly. Urban and rural wages differ (\( F = 5.19 \)) in level, not slope.
  • Break dummies test structural change: the US Phillips-curve slope was −1.36 before 1970 and 0.12 after.
  • Chapter 9 of Econometrics Made Simple covers all of this in full, with code and a full set of exercises with answers.
Econometrics Made Simple Complete Bundle coverDummies, interactions and Chow tests, with the full chapter and hundreds of graded questions. Get the textbook and the practice book together for $19 (was $24).Both books · $19

Studying more than one subject? The Complete Book Bundle includes every Economics, Statistics, Mathematics and Econometrics book we publish.

Want more questions like these, with worked answers?
The practice book has over 1,150 more, graded from easy to exam level.
Next: step 10 of 20Model Specification and Multicollinearity