Skip to content

Lesson M05.L02: Quadratic and Interaction Terms

Field Detail
Module 05 — Functional Forms & Dummy Variables
Level Graduate
Duration 30–35 min
Learning Objective Specify and interpret quadratic regression models and interaction terms; compute partial effects that vary with the level of a regressor; identify turning points; understand why main effects must always accompany interaction terms.
Provenance Wooldridge Introductory Econometrics, Ch 6.2

Explanation

Beyond Linearity

The classical linear regression model is linear in parameters — not necessarily in the variables themselves. We can introduce non-linearity in the relationship between \(y\) and \(x\) while preserving OLS validity by including polynomial terms or interaction terms as additional regressors.


Quadratic Terms

Specification

\[y = \beta_0 + \beta_1 x + \beta_2 x^2 + u\]

This is just a standard multiple regression with two regressors: \(x\) and \(x^2\). OLS estimation proceeds identically to the linear case.

Partial Effect (Marginal Effect)

The effect of \(x\) on \(y\) is no longer constant — it depends on the current level of \(x\):

\[\frac{\partial y}{\partial x} = \beta_1 + 2\beta_2 x\]

To evaluate the partial effect, you must plug in a specific value of \(x\) (commonly \(\bar{x}\), the sample mean).

Turning Point

If \(\beta_2 \neq 0\), the parabola has a turning point (maximum or minimum) at:

\[x^* = -\frac{\beta_1}{2\beta_2}\]
  • If \(\beta_2 < 0\): the parabola is inverted-U-shaped — marginal effect starts positive and eventually turns negative. Turning point is a maximum. Example: productivity first rises then falls with age.
  • If \(\beta_2 > 0\): the parabola is U-shaped — marginal effect starts negative and eventually turns positive. Turning point is a minimum. Example: costs as a function of output.

Important: You should check whether \(x^*\) lies within the support of the data. A turning point outside the observed range of \(x\) means the parabola is effectively monotone within the sample, and the quadratic may just be capturing curvature at the boundaries.

Economic Motivation

The experience-wage profile is the canonical example:

  • Early in a career, additional experience sharply raises wages (learning, promotions).
  • Later in a career, the gains diminish (skill depreciation, physical limits).
  • This generates an inverted-U shape: \(\beta_1 > 0\), \(\beta_2 < 0\).

Interaction Terms

Specification

\[y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 (x_1 \cdot x_2) + u\]

The term \(x_1 \cdot x_2\) is the interaction (or cross product) of \(x_1\) and \(x_2\).

Marginal Effect of \(x_1\)

\[\frac{\partial y}{\partial x_1} = \beta_1 + \beta_3 x_2\]

The effect of \(x_1\) on \(y\) now depends on the level of \(x_2\). This is the defining feature of an interaction model: the relationship between \(y\) and \(x_1\) is moderated by \(x_2\).

Similarly:

\[\frac{\partial y}{\partial x_2} = \beta_2 + \beta_3 x_1\]

The Main Effects Rule

Never include an interaction term without also including both of the main effects it interacts.

If you include \(x_1 x_2\) but omit \(x_1\), you are imposing the restriction \(\beta_1 = 0\) — which is a testable hypothesis, not a modelling convenience. Omitting main effects distorts the coefficient on the interaction and produces misleading estimates. This is one of the most common specification errors in applied work.

Economic Examples

  • Education × Gender: Does the return to an additional year of education differ between men and women? Include \(educ \cdot female\) as an interaction.
  • Advertising × Market size: Does the effect of advertising on sales scale with the size of the market?
  • Income × Price: Do higher-income households respond less to price changes?

Worked Example

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

Equation:

\[\log(\widehat{wage}_i) = 0.416 + 0.094\,educ_i + 0.041\,exper_i - 0.00071\,exper_i^2\]

Step 1 — Partial effect of experience at the mean

Sample mean experience: \(\bar{exper} = 17.0\) years.

\[\left.\frac{\partial \log(wage)}{\partial exper}\right|_{\bar{exper}} = 0.041 + 2(-0.00071)(17) = 0.041 - 0.024 = 0.017\]

At the mean level of experience, one more year is associated with approximately a 1.7% wage increase.

Step 2 — Turning point (peak earnings year)

\[exper^* = -\frac{0.041}{2 \times (-0.00071)} = \frac{0.041}{0.00142} \approx 28.9 \text{ years of experience}\]

Wages are predicted to peak at about 29 years of experience, after which additional experience is associated with slightly declining wages. The sample range of experience is 0–51 years, so the turning point is comfortably within the data.

Step 3 — Sign check

\(\hat{\beta}_{exper} = 0.041 > 0\) and \(\hat{\beta}_{exper^2} = -0.00071 < 0\): inverted-U shape, consistent with the expected diminishing returns profile.


Common Misconception

"The coefficient on \(x^2\) tells you the effect of \(x\) on \(y\)."

Correction: The coefficient \(\hat{\beta}_2\) on \(x^2\) is not the marginal effect of \(x\). It is not even a standalone effect — it only has meaning in conjunction with \(\hat{\beta}_1\). The correct marginal effect is:

\[\frac{\partial \hat{y}}{\partial x} = \hat{\beta}_1 + 2\hat{\beta}_2\, x\]

This expression varies with \(x\). Reporting \(\hat{\beta}_2\) alone, or treating it as "the effect of \(x\) on \(y\)," is incorrect. Always compute and report the full partial effect at a meaningful value of \(x\) (e.g. \(\bar{x}\), or several percentiles).


Practice Prompts

Prompt 1 — Partial effect and turning point A researcher estimates the following equation for job satisfaction scores (0–100):

\[\widehat{satisf} = 42 + 3.2\,tenure - 0.08\,tenure^2\]

where \(tenure\) is years with the current employer (range: 0–35 years).

(a) What is the partial effect of tenure on satisfaction at \(tenure = 10\)? (b) At what tenure does satisfaction peak? (c) Is the turning point in the sample range? What does that imply about the shape of the relationship within the data?


Prompt 2 — Interaction term A researcher estimates:

\[\widehat{\log(sales)} = 2.1 + 0.4\,\log(advert) + 0.6\,bigmarket + 0.3\,\log(advert) \times bigmarket\]

where \(bigmarket \in \{0,1\}\) indicates a large metropolitan market.

(a) What is the marginal effect of advertising (in elasticity terms) for firms in small markets? (b) What is the marginal effect for firms in large markets? (c) Interpret the coefficient 0.3 on the interaction term.


Prompt 3 — Specification error A student estimates:

\[\widehat{gpa} = 1.8 + 0.12\,study \times sleep\]

omitting \(study\) and \(sleep\) as separate regressors. Explain why this specification is problematic. What would you estimate instead?


Further Resources

  • Wooldridge, Introductory Econometrics (7th ed.), §6.2
  • Stata: gen expersq = exper^2 then reg lwage educ exper expersq
  • R: lm(log(wage) ~ educ + exper + I(exper^2), data = wage1)
  • For marginal effects at the mean in Stata: margins, dydx(exper) atmeans