Skip to content

Lesson M05.L05: Interactions Between Dummies and Continuous Variables

Field Detail
Module 05 — Functional Forms & Dummy Variables
Level Graduate
Duration 30–35 min
Learning Objective Specify and interpret dummy-continuous interaction models; understand slope-shift vs intercept-shift; conduct and interpret the Chow test; apply interaction models in policy evaluation contexts.
Provenance Wooldridge Introductory Econometrics, Ch 7.3–7.4

Explanation

Dummy × Continuous Interaction: Slope Shifts

In Lesson M05.L03 we allowed a dummy variable to shift the intercept of the regression line (parallel lines with different heights). But what if the dummy variable also changes the slope of the relationship between \(y\) and a continuous variable \(x\)?

The model:

\[y_i = \beta_0 + \beta_1 D_i + \beta_2 x_i + \beta_3 (D_i \cdot x_i) + u_i\]

Expected values by group:

\[E[y_i \mid D_i = 0, x_i] = \beta_0 + \beta_2 x_i \quad \text{(base group: slope } \beta_2\text{)}$$ $$E[y_i \mid D_i = 1, x_i] = (\beta_0 + \beta_1) + (\beta_2 + \beta_3) x_i \quad \text{(dummy group: slope } \beta_2 + \beta_3\text{)}\]

Interpretation of coefficients:

Coefficient Meaning
\(\beta_0\) Intercept for base group (\(D=0\))
\(\beta_1\) Intercept difference: group \(D=1\) vs \(D=0\)
\(\beta_2\) Slope of \(x\) for base group
\(\beta_3\) Slope difference: how much steeper (or flatter) the \(x\)-\(y\) relationship is for the \(D=1\) group

\(\hat{\beta}_3\) is the key parameter: it tells us whether the marginal effect of \(x\) on \(y\) differs between groups.

  • \(\hat{\beta}_3 > 0\): the effect of \(x\) is stronger (larger slope) for the \(D=1\) group
  • \(\hat{\beta}_3 < 0\): the effect of \(x\) is weaker for the \(D=1\) group
  • \(\hat{\beta}_3 = 0\): parallel lines (no slope difference; reduces to the model in M05.L03)

The Chow Test

The Chow test is an F-test of whether all regression coefficients differ between two groups, not just the slope.

Full unrestricted model:

\[y_i = \beta_0 + \beta_1 D_i + \beta_2 x_i + \beta_3 (D_i \cdot x_i) + u_i\]

Null hypothesis (no structural break between groups):

\[H_0: \beta_1 = 0 \text{ and } \beta_3 = 0\]

This tests whether both the intercept and the slope are the same for both groups. Rejection means the two groups have different regression functions — you should estimate them separately (or use the interaction model).

F-statistic:

\[F = \frac{(SSR_R - SSR_U)/q}{SSR_U/(n - k - 1)} \sim F_{q,\, n-k-1}\]

where \(q = 2\) (number of restrictions: \(\beta_1 = 0\) and \(\beta_3 = 0\)), \(SSR_R\) is from the restricted model (pooled, no interactions), and \(SSR_U\) is from the unrestricted model.

Alternative formulation (computationally equivalent): Run OLS separately for each group; compute \(SSR_1\) and \(SSR_2\); then:

\[F = \frac{[SSR_{pooled} - (SSR_1 + SSR_2)] / k}{(SSR_1 + SSR_2)/(n - 2k)}\]

where \(k\) is the number of coefficients in each group's model.


Policy Evaluation Application

Interactions are central to difference-in-differences (DiD) style analysis:

\[y_{it} = \beta_0 + \beta_1 Treated_i + \beta_2 Post_t + \beta_3 (Treated_i \times Post_t) + u_{it}\]

Here: - \(Treated_i \in \{0,1\}\): treatment group indicator - \(Post_t \in \{0,1\}\): post-policy period indicator - \(\beta_3\): the DiD estimator — the treatment effect, identifying causal impact under the parallel trends assumption

This is M07 content, but the structural form — dummy × dummy or dummy × continuous interactions — is the same tool introduced here.


Worked Example

Research question: Do women receive lower returns to education than men?

Model:

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

Estimated (Wooldridge WAGE1, \(n = 526\)):

\[\log(\widehat{wage_i}) = 0.389 - 0.227\, female_i + 0.082\, educ_i - 0.0056\, (female_i \times educ_i)\]
Variable Coefficient SE t-stat
Intercept 0.389 0.119 3.27
female −0.227 0.168 −1.35
educ 0.082 0.009 9.11
female × educ −0.0056 0.013 −0.43

Interpreting the slope:

  • Men (\(female = 0\)): return to education = \(0.082\) per year ≈ 8.2%
  • Women (\(female = 1\)): return to education = \(0.082 + (-0.0056) = 0.0764\) per year ≈ 7.6%

Test: Is \(\hat{\beta}_3 = -0.0056\) statistically significant? \(t = -0.43\), \(p\)-value large. We cannot reject \(H_0: \beta_3 = 0\) — the evidence does not support a statistically significant difference in the education slope between men and women in this sample.

Chow test (test both intercept and slope differences, \(H_0: \beta_1 = \beta_3 = 0\)):

Compute \(F_{2,522}\). If significant, conclude the entire wage equation differs by gender.

Important caveat: The coefficient on \(female\) (\(\hat{\beta}_1 = -0.227\)) is now the effect of being female for workers with zero years of education — not the average gender gap across all workers. When the interaction is present, the "main effect" of the dummy is evaluated at \(x = 0\).


Common Misconception

"If the interaction term is significant, \(\hat{\beta}_1\) gives the average effect of being in the dummy group."

Correction: In an interaction model, \(\hat{\beta}_1\) is the effect of \(D = 1\) when \(x = 0\) — not the average effect over all values of \(x\). The full effect of the dummy at any given value of \(x\) is:

\[\text{Effect of } D \text{ at value } x = \hat{\beta}_1 + \hat{\beta}_3 \cdot x\]

At \(x = 0\), this equals \(\hat{\beta}_1\). At the mean of \(x\), it equals \(\hat{\beta}_1 + \hat{\beta}_3 \bar{x}\). For a meaningful average effect, you must either evaluate at a substantively interesting value of \(x\) (e.g. \(\bar{x}\)) or compute the marginal effect averaged over the sample distribution of \(x\) using margins in Stata or marginaleffects in R.


Practice Prompts

Prompt 1 — Slope interpretation A researcher estimates the effect of training programs on worker productivity:

\[\widehat{output_i} = 15.2 + 4.1\, trained_i + 0.8\, months_i + 0.5\, (trained_i \times months_i)\]

where \(output\) is units produced per day, \(trained \in \{0,1\}\), and \(months\) is months on the job.

(a) What is the slope of experience (months) for untrained workers? (b) What is the slope for trained workers? (c) Interpret the coefficient 0.5 on the interaction. (d) At what level of \(months\) does the productivity of trained workers first exceed that of untrained workers?


Prompt 2 — Chow test A researcher pools data from two countries (A and B) and estimates:

\[\log(GDP_{it}) = \beta_0 + \beta_1 countryB_i + \beta_2\, invest_t + \beta_3\, (countryB_i \times invest_t) + u_{it}\]

The restricted model (no interactions, \(\beta_1 = \beta_3 = 0\)) gives \(SSR_R = 412.3\); the unrestricted model gives \(SSR_U = 388.1\); \(n = 200\), \(k = 4\).

(a) Compute the Chow F-statistic. (b) Find the critical value at the 5% level. (c) What do you conclude?


Prompt 3 — Policy evaluation A state introduces a minimum wage increase in 2020. You have quarterly employment data for affected counties (treatment) and unaffected counties (control), 2018–2022.

(a) Write the difference-in-differences regression equation, defining all variables clearly. (b) Which coefficient is the policy effect of interest? (c) What assumption is needed for \(\hat{\beta}_{DiD}\) to be a causal estimate?


Further Resources

  • Wooldridge, Introductory Econometrics (7th ed.), §7.3–7.4
  • Stata: gen femXeduc = female * educ then reg lwage female educ femXeduc, or reg lwage female##c.educ
  • R: lm(log(wage) ~ female * educ, data = wage1) — automatically creates main effects and interaction
  • Chow test in Stata: suest or separate regressions with test after seemingly unrelated estimation
  • marginaleffects R package: compute average marginal effects after interactions