Why a Slope Can Depend on Another Predictor
In an additive regression model, the fitted slope for a predictor stays the same as other predictors change. An interaction model allows a different pattern: the association between one predictor and the outcome may vary with the value of a second predictor. In that setting, a single main-effect coefficient does not describe the slope everywhere. It describes the slope at a particular reference value of the other predictor.
Centering makes that reference value explicit. If \(X\) is centered at \(c_x\), its centered value is \(X-c_x\); similarly, \(Z-c_z\) is \(Z\) centered at \(c_z\). The reference values may be means or other meaningful values. The key task here is to use the fitted interaction equation to calculate and interpret slopes at specified values.
The model assumes that the conditional mean has the stated form over the predictor values being interpreted: it is linear in each predictor when the other is held fixed, and the slope changes linearly with the other predictor. For the usual regression interpretation, errors are assumed to have mean zero conditional on the predictors; independence of errors is also generally required for standard uncertainty calculations. Constant error variance and a suitable error distribution matter for common inferential procedures, but are not needed to perform the slope arithmetic below. A fitted equation alone cannot verify these assumptions: data structure and residual diagnostics should be considered.
Conditional Slopes From the Fitted Equation
A conditional slope is the rate of change in the fitted conditional mean for one predictor while the other predictor is held fixed. In the model, fix \(Z=z\). The terms that multiply \(x-c_x\) are \(b_1\) and \(b_3(z-c_z)\), so the fitted slope for \(X\) is
Likewise, holding \(X=x\) fixed gives the fitted slope for \(Z\):
These formulas show exactly what the main-effect coefficients mean. At \(z=c_z\), the centered value \(z-c_z\) is zero, so the fitted slope for \(X\) is \(b_1\). At \(x=c_x\), the fitted slope for \(Z\) is \(b_2\). Thus \(b_1\) is the slope for \(X\) at the centering value of \(Z\), and \(b_2\) is the slope for \(Z\) at the centering value of \(X\). Neither is necessarily the slope at every value of the other predictor.
A Short Derivation
The conditional-slope formula can be obtained directly from the fitted mean. At a fixed value \(z\), compare the fitted means at \(x\) and \(x+\Delta x\), then divide their difference by \(\Delta x\). The terms involving only \(z\) cancel:
The expression does not depend on the size of \(\Delta x\), provided \(\Delta x\ne0\). So it is the fitted change in the response per one-unit increase in \(X\) while \(Z\) is held fixed, not merely an approximation for a very small change. Repeating the same subtraction while changing \(z\) and holding \(x\) fixed gives \(b_2+b_3(x-c_x)\).
Worked Calculations
Worked Example: Study Hours and Sleep
Suppose a hypothetical fitted model predicts exam score, in points, from study hours per week \(X\) and sleep hours per night \(Z\). The predictors are centered at \(c_x=5\) study hours and \(c_z=7\) sleep hours. Assume the interaction model is considered an adequate description over the values discussed, observations are independent, and residual checks do not show a marked failure of the mean-model form. The fitted equation is
The fitted study-hours slope at \(Z=6\) is
At six hours of sleep per night, the model therefore associates one additional weekly study hour with a fitted increase of 2.7 exam-score points, holding sleep fixed. At the centering value \(Z=7\), the slope is \(b_1=2.4\) points per study hour. The main effect \(2.4\) is not the slope at every sleep duration.
For comparison, the fitted sleep-hours slope at \(X=8\) is
At eight weekly study hours, one additional hour of sleep per night is associated with a fitted increase of 0.20 exam-score points, holding study hours fixed. These are model-based associations; this example does not establish that changing study or sleep habits would cause the predicted changes.
Worked Example: A Reference Value That Is Not a Mean
Suppose a hypothetical model relates a performance score in points to practice hours per week \(X\) and feedback sessions per month \(Z\). The chosen centering values are 4 practice hours and 2 feedback sessions; they are meaningful reference values, not necessarily sample means. Assume the linear interaction form is adequate over the values used, and the observations and residual behavior support the usual model interpretation. The fitted equation is
At \(Z=5\) sessions per month, the fitted slope for practice hours is
The fitted slope for feedback sessions at \(X=8\) practice hours is
Here \(b_1=1.5\) is the practice-hours slope at 2 feedback sessions per month, and \(b_2=0.8\) is the feedback-session slope at 4 practice hours per week. The fact that the centering values were chosen for interpretation rather than calculated as averages does not change these meanings.
Worked Example: Reading the Interaction Units
Consider a hypothetical fitted model for apartment rent in dollars per month using floor area \(X\) in square metres and distance from a transit stop \(Z\) in kilometres. Let \(c_x=70\) square metres and \(c_z=1.5\) kilometres. Assume the fitted interaction form is adequate over the area and distance values being considered, and that the data collection and residual diagnostics do not indicate an evident violation relevant to this interpretation. Suppose
At a distance of \(2.0\) kilometres, the fitted area slope is
For apartments 2.0 kilometres from the transit stop, the model associates one additional square metre of area with a fitted increase of 16 dollars in monthly rent, holding distance fixed. At the centering distance of 1.5 kilometres, the slope is \(18\) dollars per month per square metre.
At an area of \(90\) square metres, the fitted distance slope is
For apartments of 90 square metres, the fitted rent decreases by 200 dollars per month for each additional kilometre from the transit stop, according to this model. The interaction coefficient has units of dollars per month per (square metre times kilometre). Multiplying it by a distance difference adjusts the area slope; multiplying by an area difference adjusts the distance slope.
Reading Conditional Slopes Carefully
The sign and size of \(b_3\) explain how slopes vary. If \(b_3\) is positive, the fitted slope for \(X\) increases as \(Z\) increases, and the fitted slope for \(Z\) increases as \(X\) increases. If \(b_3\) is negative, each slope decreases as the other predictor increases. This describes how the fitted slopes change; it does not by itself say whether either conditional slope is positive or negative at a particular value. Calculate that slope using the relevant formula.
Always retain the reference value in the calculation. For example, the adjustment to \(b_1\) is \(b_3(z-c_z)\), not \(b_3z\). A value of \(z\) equal to \(c_z\) produces no adjustment. Also check that the requested predictor values lie in a region where the model is supported. A mathematically calculable slope far beyond the observed range may not be a useful interpretation.
A conditional slope describes the fitted association with one predictor while the other is held fixed. In observational data, this is not automatically a causal effect. A causal interpretation requires additional design and assumptions beyond the interaction equation.
Check Your Understanding
Use the fitted-model interpretation and formulas above to answer each question.
- In a fitted model with \(c_x=10\), \(c_z=4\), \(b_1=3\), and \(b_3=0.5\), calculate the fitted slope for \(X\) when \(Z=6\). Include its interpretation as a change in fitted response per unit of \(X\).
- In the same model, what does \(b_1\) represent when \(Z=4\)?
- If \(b_2=-2\), \(b_3=0.5\), and \(X=8\), calculate the fitted slope for \(Z\). What are its units in terms of the response and \(Z\)?
- Explain why a positive interaction coefficient does not guarantee a positive conditional slope for either predictor at every value.
- A researcher describes a conditional slope from an observational interaction model as a causal effect. What additional caution is needed?