Tutorials › Introduction to Statistics › Interactions Between Quantitative Predictors

Introduction to Multiple Regression · Tutorial 931 of 996

Interactions Between Quantitative Predictors

See how a product term lets the fitted effect of one quantitative predictor vary with the value of another, and how to interpret the resulting coefficients and predictions.

Intermediate 10 min read

What You'll Learn

  • Write a multiple regression model with a product term for two quantitative predictors.
  • Interpret each predictor’s fitted slope as a function of the other predictor.
  • Calculate and compare fitted slopes at different predictor values.
  • Interpret the product-term coefficient in context and with units.
  • Use centering to make main-effect coefficients more meaningful without changing fitted predictions.
  • Distinguish a fitted interaction from evidence of causation.

Why Let a Slope Change?

In an additive multiple regression model, the fitted change in the response associated with one predictor is the same at every fixed value of the other predictors. That may be too restrictive. For example, an additional hour of study might be associated with a larger score increase for students with stronger preparation than for students with weaker preparation. An interaction between two quantitative predictors represents this kind of changing slope.

The interaction is represented by adding the product of the two predictors to the regression equation. The product term does not merely add another independent predictor: it changes how the fitted response varies with each of the original predictors.

The Model and Its Coefficients

Let \(X_1\) and \(X_2\) be quantitative predictors and \(Y\) the response. A multiple regression model with their interaction is

$$ Y=\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_1X_2+\varepsilon. $$

Here, \(\beta_0,\beta_1,\beta_2,\beta_3\) are model coefficients and \(\varepsilon\) is the error: the difference between an observed response and the conditional mean specified by the model. Equivalently, the model says

$$ E(Y\mid X_1,X_2)=\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_1X_2. $$

The conditional mean is linear in the coefficients, but the relationship between \(Y\) and one predictor depends on the other predictor. In practice, the coefficients are estimated from data; the fitted model uses estimates such as \(b_0,b_1,b_2,b_3\) in place of the corresponding population coefficients.

Definition: An interaction between two quantitative predictors is represented in this model by the product term \(X_1X_2\). Its coefficient \(\beta_3\) describes how the fitted slope for one predictor changes as the other predictor increases. If \(\beta_3=0\), the model reduces to an additive model with constant fitted slopes.

To interpret the slopes, hold one predictor fixed and examine the conditional mean as the other changes. Holding \(X_2=x_2\) fixed gives

$$ E(Y\mid X_1,x_2)=(\beta_0+\beta_2x_2)+(\beta_1+\beta_3x_2)X_1. $$

Thus, the fitted slope for \(X_1\), at a particular value \(x_2\) of \(X_2\), is \(\beta_1+\beta_3x_2\). Reversing the roles of the predictors shows that the fitted slope for \(X_2\), at \(X_1=x_1\), is \(\beta_2+\beta_3x_1\). The two slopes are conditional: each describes a change in fitted mean response while the other predictor is held fixed.

Interpretation: The coefficient \(\beta_3\) is the change in the fitted slope for \(X_1\) associated with a one-unit increase in \(X_2\). It is also the change in the fitted slope for \(X_2\) associated with a one-unit increase in \(X_1\). Its units are response units divided by the product of the two predictor units.

The coefficients \(\beta_1\) and \(\beta_2\) are not generally the slopes across all predictor values. Specifically, \(\beta_1\) is the fitted slope for \(X_1\) when \(X_2=0\), and \(\beta_2\) is the fitted slope for \(X_2\) when \(X_1=0\). If zero is outside the observed or meaningful range of a predictor, these main-effect coefficients may be difficult to interpret directly. Centering predictors can help, as shown below.

Worked Examples

Worked Example: How the Study-Time Slope Changes

Suppose a hypothetical sample of students is used to fit a model predicting final-exam score \(Y\), in points, from weekly study time \(X_1\), in hours, and an incoming preparation score \(X_2\), in points. Suppose the fitted equation is

$$ \hat{Y}=12+2.4X_1+0.30X_2+0.08X_1X_2. $$

Assume the observations are independent and the observed predictor values cover the study times and preparation scores considered below. For this interpretation, also assume the model’s conditional mean is adequately represented by the equation over that range. The calculation describes fitted associations; it does not establish that changing study time causes a score change.

At a preparation score of 50 points, the fitted slope for study time is

$$ 2.4+0.08(50)=2.4+4.0=6.4 \quad\text{points per study hour}. $$

At a preparation score of 70 points, the slope is

$$ 2.4+0.08(70)=2.4+5.6=8.0 \quad\text{points per study hour}. $$

The fitted study-time slope is therefore 1.6 points per hour larger at 70 than at 50 preparation points. This difference also follows directly from the interaction coefficient: \(0.08(70-50)=1.6\) points per study hour. The positive product-term coefficient means the fitted study-time slope increases as preparation score increases.

For a concrete prediction, at \(X_1=5\) hours and \(X_2=50\) points,

$$ \hat{Y}=12+2.4(5)+0.30(50)+0.08(5)(50) =12+12+15+20=59\text{ points}. $$

This is the model’s predicted mean score for those predictor values, not a guarantee that an individual student will score 59 points.

Worked Example: A Negative Interaction

Consider a hypothetical regression relating resting heart rate \(Y\), in beats per minute, to weekly activity \(X_1\), in hours, and age \(X_2\), in years. Suppose the fitted equation is

$$ \hat{Y}=82-0.10X_1+0.20X_2-0.015X_1X_2. $$

Suppose the data are independent observations, the model is being interpreted only across the observed activity and age ranges, and the conditional mean is adequately described by this equation there. These conditions support interpreting the fitted associations in that range; they do not make them causal.

The fitted slope for weekly activity at age \(x_2\) is \(-0.10-0.015x_2\) beats per minute per additional activity hour. At age 30, it is

$$ -0.10-0.015(30)=-0.10-0.45=-0.55 \quad\text{beats per minute per activity hour}. $$

At age 50, it is

$$ -0.10-0.015(50)=-0.10-0.75=-0.85 \quad\text{beats per minute per activity hour}. $$

The fitted slope is 0.30 beats per minute per activity hour more negative at age 50 than at age 30. Equivalently, the interaction coefficient gives \(-0.015(50-30)=-0.30\). The negative interaction indicates that the fitted activity slope decreases as age increases.

For a prediction at 3 activity hours per week and age 40 years, substitute both predictor values, including their product:

$$ \hat{Y}=82-0.10(3)+0.20(40)-0.015(3)(40) =82-0.3+8-1.8=88.0 \quad\text{beats per minute}. $$

The product \(3(40)\) is part of the calculation. Leaving it out would amount to predicting from a different, additive model.

Why the Product Term Changes the Slope

The slope formulas follow by collecting the terms involving one predictor. For fixed \(X_2=x_2\), the parts of the conditional mean involving \(X_1\) are \(\beta_1X_1+\beta_3X_1x_2\). Factoring out \(X_1\) gives \((\beta_1+\beta_3x_2)X_1\), so the coefficient of \(X_1\)—and thus its fitted slope—is \(\beta_1+\beta_3x_2\). The same reasoning with \(X_1=x_1\) fixed gives the slope \(\beta_2+\beta_3x_1\) for \(X_2\).

A finite-change version makes the interpretation especially clear. If \(X_2\) increases by \(\Delta x_2\), the fitted slope for \(X_1\) changes by

$$ (\beta_1+\beta_3(x_2+\Delta x_2))-(\beta_1+\beta_3x_2) =\beta_3\Delta x_2. $$

This is why \(\beta_3\) is described as a change in slope per unit of the other predictor. It is not, by itself, the slope for either predictor or the predicted response change for an observation.

Centering Predictors

Centering replaces each predictor with its difference from a chosen reference value. It can make the main-effect coefficients more useful when a predictor’s zero is not meaningful. In the study-time example, let \(U=X_1-5\) and \(V=X_2-60\), so \(U\) measures hours relative to 5 and \(V\) measures preparation points relative to 60. Substituting \(X_1=U+5\) and \(X_2=V+60\) into the fitted equation gives

$$ \begin{aligned} \hat{Y} &=12+2.4(U+5)+0.30(V+60)+0.08(U+5)(V+60)\\ &=66+7.2U+0.70V+0.08UV. \end{aligned} $$

For example, the intercept is 66 points: the predicted score at 5 study hours and 60 preparation points. The coefficient 7.2 is now the fitted study-time slope at a preparation score of 60, rather than at a preparation score of zero. The coefficient 0.70 is the fitted preparation-score slope at 5 study hours. The interaction coefficient remains 0.08, and centering does not change fitted predictions: the new variables simply express the same predictor values relative to reference points.

Key takeaway: With a quantitative-by-quantitative interaction, report a predictor’s fitted slope at specified values of the other predictor. The main-effect coefficient alone describes the slope only when the other predictor equals zero—or the centering reference value in a centered model.

Assumptions and Common Pitfalls

A regression interpretation depends on the model being appropriate for the question and data. The interaction equation assumes that, at each fixed value of one predictor, the conditional mean is linear in the other predictor, with its slope changing linearly according to the interaction term. Interpretations should be restricted to predictor values for which the model is supported by data; a computed slope far beyond the observed range may be an unreliable extrapolation.

For usual regression inference, additional conditions are needed for the error term. In particular, the errors should have conditional mean zero and be independent with constant variance; normal errors are used for exact small-sample \(t\)-based inference. A fitted product-term coefficient alone does not establish that an interaction is statistically distinguishable from zero. Testing that coefficient is a separate inferential question.

  • Misreading a main effect: Saying “the study-time slope is 2.4 points per hour” in the first example ignores the product term. The correct slope is \(2.4+0.08X_2\), so it must be stated at a preparation score.
  • Misreading the product coefficient: The value 0.08 is not the score increase from one more study hour. It is the change in the study-time slope per additional preparation point.
  • Forgetting units: A slope has response units per predictor unit; the interaction coefficient has response units per product of predictor units.
  • Claiming causation: A fitted interaction describes how an association changes across predictor values. Without an appropriate causal design and assumptions, it does not show that changing a predictor causes the response to change.

Check Your Understanding

Use the model and definitions above to answer these questions.

  1. In a model with interaction coefficient \(\beta_3\), write the fitted slope for \(X_1\) when \(X_2=x_2\).
  2. If \(\beta_3=0.12\), how much does the fitted slope for \(X_1\) change when \(X_2\) increases by 5 units?
  3. In the equation \(\hat{Y}=4+3X_1-2X_2+0.5X_1X_2\), what is the fitted slope for \(X_1\) when \(X_2=6\)? Include units if \(Y\) is measured in centimeters and both predictors in meters.
  4. Why can centering \(X_2\) make the coefficient of \(X_1\) easier to interpret in an interaction model?
  5. Does a positive interaction coefficient prove that increasing \(X_2\) causes the effect of \(X_1\) to become more positive? Explain.