Skip to content

Polynomials and Interaction Terms

A quadratic term lets the marginal effect of a regressor change with its own level. In y=β0+β1x+β2x2+uy=\beta_0+\beta_1 x+\beta_2 x^2+u, the slope is β1+2β2x\beta_1+2\beta_2 x, so the effect of xx rises or falls as xx grows, with a turning point at x=β1/(2β2)x^{*}=-\beta_1/(2\beta_2). An interaction term makes the effect of one variable depend on a second variable. In y=β0+β1x1+β2x2+β3x1x2+uy=\beta_0+\beta_1 x_1+\beta_2 x_2+\beta_3 x_1 x_2+u, the partial effect of x1x_1 is β1+β3x2\beta_1+\beta_3 x_2. In both cases a single coefficient no longer tells the whole story.

Try it yourself

Model specification sandbox

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.

Marginal effect at x = 8.0∂y/∂x = 1.28
616263545481216xy
∂y/∂x at x 1.28turning point x* 17.14
β₁ (linear term)2.40
β₂ (squared term)-0.070
evaluate ∂y/∂x at x8.0
The effect of x is not one number. At x = 8.0 the slope is ∂y/∂x = β₁ + 2β₂x = 1.28. Move x and it bends. The curve has a maximum at x* = −β₁/(2β₂) = 17.14 (inside the data).
Try this

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

Quadratic marginal effect and turning point
yx=β1+2β2x,x=β12β2\frac{\partial y}{\partial x}=\beta_1+2\beta_2 x,\qquad x^{*}=-\frac{\beta_1}{2\beta_2}
The effect of xx is not constant. xx^{*} is the level of xx where the effect flips sign (a maximum if β2<0\beta_2<0, a minimum if β2>0\beta_2>0).
Interaction: partial effect of $x_1$
yx1=β1+β3x2\frac{\partial y}{\partial x_1}=\beta_1+\beta_3 x_2
β1\beta_1 alone is the effect of x1x_1 only when x2=0x_2=0, which may be outside the data. Evaluate at a meaningful x2x_2 such as its mean.

Worked examples

Scenario

Wage rises with experience but at a decreasing rate.

Solution

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 x=0.041/(2×0.00071)29x^{*}=0.041/(2\times0.00071)\approx 29 years, after which extra experience is associated with lower wages.

NoteUse `margins, dydx(exper) at(exper=(5 10 20 30))` to report the slope at chosen experience levels.
Scenario

Does the return to education differ by gender?

Solution

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 β1\beta_1 in a quadratic as the effect of xx. The effect is β1+2β2x\beta_1+2\beta_2 x and changes at every value of xx.
  • 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 xx^{*} 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 β1+β3x2\beta_1+\beta_3 x_2 and depends on where you evaluate x2x_2.

Revision bullets

  • Quadratic slope is β1+2β2x\beta_1+2\beta_2 x, not β1\beta_1.
  • Turning point sits at x=β1/(2β2)x^{*}=-\beta_1/(2\beta_2).
  • Interaction makes the effect of x1x_1 depend on x2x_2: β1+β3x2\beta_1+\beta_3 x_2.
  • 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 x1x_1, x2x_2, and their interaction x1x2x_1 x_2, the partial effect of x1x_1 is:

Connected topics

Sources

  1. Wooldridge (2019), §6.2
    Wooldridge, 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.
  2. Wooldridge (2019), §7.4
    Wooldridge, 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.
How to cite this page
Dr. Phil's Quant Lab. (2026). Polynomials and Interaction Terms. Derivatives Atlas. https://phucnguyenvan.com/concept/efm-polynomials-interactions