Tutorials › Regression Analysis (Undergraduate) › Centering One Predictor in an Interaction

Units, Scaling, and Centering · Tutorial 165 of 991

Centering One Predictor in an Interaction

Learn to re-express a two-predictor interaction model after centering one predictor and interpret the changed coefficient in context.

Intermediate 9 min read

What You'll Learn

  • Rewrite an interaction model after centering exactly one predictor.
  • Interpret the changed main-effect coefficient as a conditional slope at the centering point.
  • Identify which coefficients remain unchanged and why.
  • Calculate new coefficients and verify that predictions are preserved.
  • Avoid interpreting a main-effect coefficient without specifying the value of the interacting predictor.

Why Center One Predictor in an Interaction?

In a model with an interaction, the association between one predictor and the outcome depends on the value of the other predictor. As a result, a main-effect coefficient does not generally describe an overall or average slope: it describes the slope when the interacting predictor equals zero. If zero is outside the observed range or has little practical meaning, that coefficient may be hard to interpret.

Centering one predictor offers a direct solution. We subtract a chosen reference value from that predictor while leaving the other predictor unchanged. The coefficient of the uncentered predictor then describes its conditional slope when the centered predictor is at the chosen reference value. The fitted relationship itself does not change; only the reference point used for interpreting a coefficient changes.

The Model and the Reparameterization

Consider a linear regression model with predictors \(X_1\) and \(X_2\), including their interaction:

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

Here \(Y\) is the outcome, \(\beta_0,\beta_1,\beta_2,\beta_3\) are model coefficients, and \(\varepsilon\) is an error term. For the conditional-mean interpretations below, assume \(E(\varepsilon\mid X_1,X_2)=0\), so the displayed regression expression gives the conditional mean of \(Y\). The interaction term allows the slope for one predictor to vary with the other. In particular, at a fixed value \(X_2=x_2\), the conditional slope for \(X_1\) is \(\beta_1+\beta_3x_2\).

Definition: To center \(X_2\) at a chosen value \(c\), define \(Z_2=X_2-c\). The centered predictor \(Z_2\) equals zero exactly when the original predictor \(X_2\) equals \(c\). In this tutorial \(X_1\) is left uncentered.

Substitute \(X_2=Z_2+c\) into the model and collect terms:

$$ \begin{aligned} Y &=\beta_0+\beta_1X_1+\beta_2(Z_2+c)+\beta_3X_1(Z_2+c)+\varepsilon\\ &=(\beta_0+c\beta_2)+(\beta_1+c\beta_3)X_1+\beta_2Z_2+\beta_3X_1Z_2+\varepsilon. \end{aligned} $$

This algebra shows the central result. Centering \(X_2\) changes the coefficient of \(X_1\) from \(\beta_1\) to \(\beta_1+c\beta_3\). The coefficient of \(Z_2\) stays \(\beta_2\), and the interaction coefficient stays \(\beta_3\). The intercept changes to \(\beta_0+c\beta_2\).

Theorem: In the interaction model, after replacing \(X_2\) by \(Z_2=X_2-c\), the coefficient of \(X_1\) is \(\beta_1+c\beta_3\). This is the conditional slope for \(X_1\) when \(X_2=c\), because \(Z_2=0\) at that point. Centering changes the coefficient’s reference point, not the fitted relationship.

Interpreting the Changed Coefficient

The same interpretation follows by looking directly at the original model’s conditional slope. Holding \(X_2=x_2\) fixed, the terms involving \(X_1\) are \(\beta_1X_1+\beta_3X_1x_2\), so the slope for \(X_1\) is \(\beta_1+\beta_3x_2\). At the centering value \(x_2=c\), that slope is \(\beta_1+c\beta_3\)—exactly the coefficient of \(X_1\) in the centered model.

The coefficient of \(Z_2\) has a different reference point. In the centered model, the conditional slope for \(Z_2\), holding \(X_1=x_1\) fixed, is \(\beta_2+\beta_3x_1\). Since \(Z_2\) and \(X_2\) differ only by a constant, this is also the slope for \(X_2\) at \(X_1=x_1\). Its main-effect coefficient \(\beta_2\) therefore still represents the slope for \(X_2\) when \(X_1=0\). Centering \(X_2\) does not change that reference point.

These interpretations apply equally to estimated coefficients. If a fitted model has estimates \(b_1\) and \(b_3\), then after centering \(X_2\) at \(c\), the coefficient of \(X_1\) becomes \(b_1+cb_3\). The product \(cb_3\) must use compatible units: if \(X_2\) is measured in years, \(c\) is in years and \(b_3\) is expressed per unit of \(X_2\).

Worked Example: Centering Age at 50 Years

Suppose, in a hypothetical analysis of 60 adults, the fitted model for systolic blood pressure \(Y\), measured in mmHg, uses activity hours per week \(X_1\) and age \(X_2\), measured in years:

$$ \widehat{Y}=120-0.8X_1+0.4X_2+0.03X_1X_2. $$

The estimated activity slope at age \(x_2\) is \(-0.8+0.03x_2\) mmHg per additional activity hour per week. The coefficient \(-0.8\) is therefore the estimated activity slope at age zero, which is not a useful reference for this adult sample. Center age at \(c=50\): let \(Z_2=X_2-50\), so \(X_2=Z_2+50\).

Substituting and collecting terms gives:

$$ \begin{aligned} \widehat{Y} &=120-0.8X_1+0.4(Z_2+50)+0.03X_1(Z_2+50)\\ &=140+0.7X_1+0.4Z_2+0.03X_1Z_2. \end{aligned} $$

The new activity coefficient is \(-0.8+(0.03)(50)=0.7\) mmHg per activity hour per week. It describes the estimated activity slope at age 50. The age-related coefficient remains \(0.4\) mmHg per year at \(X_1=0\), and the interaction coefficient remains \(0.03\). These are changes in the model’s parameterization; they do not establish that activity causes a change in blood pressure.

Predictions Stay the Same

Centering is a change of coordinates in the model, not a change to the underlying relationship. To see why, each original predictor value \(X_2\) corresponds to exactly one centered value \(Z_2=X_2-c\). The algebraic substitution above rewrites the same expression for every \(X_1\) and \(X_2\), so the predicted outcome at each pair of predictor values is unchanged.

When the same observations are used and the model retains \(X_1\), \(X_2\) (or \(Z_2\)), and their interaction, the set of fitted relationships is the same. Ordinary least squares therefore gives the same fitted values and residuals under this reparameterization; the corresponding coefficients are expressed in the new form. This conclusion depends on retaining the full interaction model. It does not mean that arbitrary changes to predictors or model terms leave predictions unchanged.

Worked Example: Checking a Prediction Before and After Centering

Consider a hypothetical fitted model predicting a productivity score from training sessions \(X_1\) and age \(X_2\), in years:

$$ \widehat{Y}=70+2X_1+0.5X_2+0.1X_1X_2. $$

Center age at 40 years, so \(Z_2=X_2-40\). The transformed coefficients are:

$$ \begin{aligned} \text{intercept}&=70+(0.5)(40)=90,\\ \text{coefficient of }X_1&=2+(0.1)(40)=6. \end{aligned} $$

Thus the centered equation is \(\widehat{Y}=90+6X_1+0.5Z_2+0.1X_1Z_2\). For a person with 3 training sessions and age 55, \(Z_2=55-40=15\). Using the original equation gives:

$$ 70+(2)(3)+(0.5)(55)+(0.1)(3)(55)=120. $$

Using the centered equation gives:

$$ 90+(6)(3)+(0.5)(15)+(0.1)(3)(15)=120. $$

Both parameterizations predict a score of 120. The coefficient of \(X_1\) is now 6 score points per additional training session when age is 40 years; at age 55, the conditional training slope is \(6+(0.1)(15)=7.5\) score points per session.

Choosing the Centering Value

The centering value \(c\) should be chosen to make the conditional slope useful to interpret. It might be a meaningful benchmark, such as age 50, or a value near the center of the observed range. If \(c\) is the sample mean of \(X_2\), the new coefficient of \(X_1\) is the fitted conditional slope at that sample mean. It is not automatically an average of individual-specific slopes under every possible interpretation; it is the slope evaluated at the chosen value.

The value should also be within, or at least close to, the range where the data provide information. Centering at a value far outside the observed range can produce a mathematically valid coefficient that represents an extrapolated conditional slope. Centering does not create observations at that value or resolve limitations in the data.

Worked Example: Choosing a Reference Point for Study Hours

Suppose a hypothetical sample of 40 students is used to model exam score \(Y\) from tutoring hours per week \(X_1\) and independent study hours per week \(X_2\). The fitted equation is:

$$ \widehat{Y}=62+1.2X_1+0.8X_2-0.15X_1X_2. $$

The tutoring slope at \(x_2\) study hours is \(1.2-0.15x_2\) exam points per additional tutoring hour per week. Suppose six study hours per week is a useful reference point in the observed range. Set \(Z_2=X_2-6\). Then the coefficient of tutoring hours becomes:

$$ 1.2+(-0.15)(6)=0.30. $$

After centering, the model is \(\widehat{Y}=66.8+0.30X_1+0.8Z_2-0.15X_1Z_2\), because the intercept changes to \(62+(0.8)(6)=66.8\). The coefficient \(0.30\) says that, in this fitted model, the conditional exam-score slope for tutoring is 0.30 points per additional tutoring hour per week at six study hours per week. It does not say that the slope is 0.30 at every level of study time.

Common Mistake

A frequent misreading is to say, “The \(X_1\) coefficient changed after centering, so the effect of \(X_1\) changed.” That treats the coefficient as if it described one fixed slope across all values of \(X_2\). In an interaction model the slope depends on \(X_2\), and the coefficient is tied to the reference value \(X_2=0\) in the original model or \(X_2=c\) in the centered model.

The correction is to state the conditioning value and units whenever interpreting a main-effect coefficient. For example: “The estimated slope for activity is 0.7 mmHg per activity hour per week at age 50,” rather than simply, “The activity effect is 0.7.” Centering changes neither the conditional slope at a given original value of \(X_2\) nor the model’s predictions. It changes which conditional slope is written as the main-effect coefficient.

Key takeaway: When \(X_2\) is centered at \(c\) in a model containing \(X_1X_2\), the coefficient of \(X_1\) becomes \(\beta_1+c\beta_3\). It represents the conditional slope for \(X_1\) at \(X_2=c\); the interaction coefficient and fitted predictions are preserved.

Check Your Understanding

Use the coefficient transformation and the conditional-slope interpretation to answer these questions.

  1. In a model with coefficients \(\beta_1=1.5\) and \(\beta_3=-0.2\), what is the coefficient of \(X_1\) after centering \(X_2\) at \(c=4\)? What conditional slope does it represent?
  2. After centering \(X_2\), which coefficient remains the coefficient of the centered predictor’s main effect, and what value of \(X_1\) is its reference point?
  3. A researcher centers age at 30 years even though the observations range from 45 to 70 years. Why should the resulting main-effect interpretation be treated cautiously?
  4. Explain why the coefficient of \(X_1\) can change after centering while the prediction for a fixed pair of original predictor values does not.
  5. In context, what information must be included when reporting the coefficient of \(X_1\) from an interaction model?