Polynomials and Interaction Terms
A quadratic term lets the marginal effect of a regressor change with its own level. In , the slope is , so the effect of rises or falls as grows, with a turning point at . An interaction term makes the effect of one variable depend on a second variable. In , the partial effect of is . In both cases a single coefficient no longer tells the whole story.
Try it yourself
One model, many specifications. See how functional form, a squared term, and a dummy variable each change what a coefficient means and how the fitted line bends. The same seeded data sit under all three views.
Discussion. Slide the evaluation point across the curve and watch ∂y/∂x change sign at x*. If the turning point sits far outside the data, is it telling you anything real, or is the relationship simply monotone over what you observe?
ŷ = β₀ + β₁x + β₂x². The marginal effect ∂y/∂x = β₁ + 2β₂x changes with x; the turning point is x* = −β₁/(2β₂) (a maximum if β₂ < 0, a minimum if β₂ > 0), undefined when β₂ = 0. β₀ is pinned so the curve passes through the sample mean.
Why it matters
Experience helps your wage a lot early on and less later, so a straight line is the wrong shape and a curve fits better. That curvature is what the squared term buys you. Interactions answer a different question. Does the payoff to education depend on gender, or does the effect of fertilizer depend on rainfall? When the answer is yes, you multiply the two variables together and let the data estimate how one effect bends with the other.
Formulas
Worked examples
Wage rises with experience but at a decreasing rate.
Run `regress lwage educ c.exper##c.exper`. The factor syntax `c.exper##c.exper` adds both `exper` and its square. If the slopes are about 0.041 on `exper` and -0.00071 on `exper` squared, the return to experience peaks at years, after which extra experience is associated with lower wages.
Does the return to education differ by gender?
Run `regress lwage c.educ##i.female`. The interaction coefficient is the gap between the return to education for women and for men. A positive, significant interaction means each year of schooling pays off more for women in the sample, so the education slope is not a single number across groups.
Common mistakes
- ✗Reading in a quadratic as the effect of . The effect is and changes at every value of .
- ✗Dropping the level term when you include the square, or the main effects when you include an interaction. Both lower-order terms must stay in for the higher-order term to be interpretable.
- ✗Treating the turning point as economically real even when it sits far outside the data range. Often the relationship is just monotone over the observed values.
- ✗Calling a single interaction coefficient "the effect." The full partial effect is and depends on where you evaluate .
Revision bullets
- •Quadratic slope is , not .
- •Turning point sits at .
- •Interaction makes the effect of depend on : .
- •Always keep main effects when adding a square or an interaction.
- •Use Stata `margins, dydx()` to report effects at chosen values.
Quick check
In `regress y c.x##c.x`, the slopes are 4 on x and -0.5 on x squared. The effect of x turns negative beyond:
In a model with , , and their interaction , the partial effect of is:
Connected topics
Sources
- Wooldridge (2019), §6.2Wooldridge, Jeffrey M. Introductory Econometrics: A Modern Approach. 7th ed. Cengage, 2019.Develops quadratics, the turning-point formula, and interaction terms with their partial-effect interpretation.
- Wooldridge (2019), §7.4Wooldridge, Jeffrey M. Introductory Econometrics: A Modern Approach. 7th ed. Cengage, 2019.Covers interactions involving dummy variables and how to test whether an interaction effect is significant.