Tutorials › Regression Analysis (Undergraduate) › Centering a Predictor in a Group Interaction

Units, Scaling, and Centering · Tutorial 167 of 991

Centering a Predictor in a Group Interaction

Use a centered interaction model to interpret the group difference at a chosen predictor value and the fitted slope for each group.

Intermediate 9 min read

What You'll Learn

  • Write a quantitative-by-binary-group interaction model using a centered predictor.
  • Interpret the intercept and group contrast at the centering value.
  • Find each group’s fitted slope and the difference between those slopes.
  • Calculate fitted group contrasts away from the centering value.
  • Explain which coefficients change when the centering value changes and why predictions do not.

Why Center the Predictor in a Group Interaction?

When a regression model allows the relationship between a quantitative predictor and an outcome to differ across two groups, it contains an interaction. In the uncentered model, the group coefficient describes the difference between groups when the quantitative predictor is zero. That may not be a useful comparison if zero is outside the data or has no practical meaning. Centering shifts the reference point: the group coefficient then describes the group contrast at the chosen centering value.

Centering does not remove the interaction or make the fitted group relationships parallel. It changes the reference value used to interpret certain coefficients. The interaction coefficient still expresses how much the two groups’ slopes differ.

The Centered Quantitative-by-Group Model

Let \(X_i\) be a quantitative predictor for observation \(i\), and let \(G_i\) be a binary group indicator coded \(0\) for the reference group and \(1\) for the comparison group. Choose a centering value \(c\), in the same units as \(X_i\), and define the centered predictor \(X_i-c\). The model is

$$ Y_i=\beta_0+\beta_1(X_i-c)+\beta_2G_i+\beta_3(X_i-c)G_i+\varepsilon_i. $$

Here \(Y_i\) is the outcome, \(\varepsilon_i\) is the error, and the \(\beta\) terms are population coefficients. In a fitted model, their estimates are written \(b_0,b_1,b_2,b_3\). The interaction term \((X_i-c)G_i\) allows the slope for \(X\) to differ between the groups.

Model assumptions: The conditional mean of \(Y\) is a straight line in \(X\) within each group, with a possibly different intercept and slope for each group. The observations are independent, and the errors have conditional mean zero given \(X\) and \(G\). The usual standard regression assumptions also include constant error variance; normal errors are used when exact small-sample \(t\)- or \(F\)-inference is required. The coefficient interpretations below follow from the stated conditional-mean model; they do not by themselves establish that an association is causal.

To interpret the coefficients, set \(G=0\) and \(G=1\) in turn. For the reference group, the model reduces to

$$ E(Y\mid X,G=0)=\beta_0+\beta_1(X-c). $$

For the comparison group, it becomes

$$ E(Y\mid X,G=1)=(\beta_0+\beta_2)+(\beta_1+\beta_3)(X-c). $$

These equations give the central interpretations. At \(X=c\), the reference group’s fitted mean is \(\beta_0\), and the comparison group’s fitted mean is \(\beta_0+\beta_2\). Thus \(\beta_2\) is the comparison-minus-reference group contrast at \(X=c\). The reference group’s slope is \(\beta_1\), while the comparison group’s slope is \(\beta_1+\beta_3\). Therefore, \(\beta_3\) is the difference between the group-specific slopes: comparison-group slope minus reference-group slope.

Key interpretation: With \(G=0\) for the reference group and \(G=1\) for the comparison group, centering at \(c\) makes \(\beta_2\) the group contrast at \(X=c\). The group slopes are \(\beta_1\) and \(\beta_1+\beta_3\); the interaction coefficient \(\beta_3\) is their difference.

How the Group Contrast Changes With \(X\)

The group contrast need not be the same at all values of \(X\). Subtract the reference-group conditional mean from the comparison-group conditional mean:

$$ \begin{aligned} &E(Y\mid X,G=1)-E(Y\mid X,G=0)\\ &=(\beta_0+\beta_2)+(\beta_1+\beta_3)(X-c) -\{\beta_0+\beta_1(X-c)\}\\ &=\beta_2+\beta_3(X-c). \end{aligned} $$

At the centering value \(X=c\), this contrast is \(\beta_2\). At another value, it is \(\beta_2+\beta_3(X-c)\). If \(\beta_3\) is positive, the comparison-minus-reference contrast increases as \(X\) increases; if it is negative, that contrast decreases. This describes the fitted model, not necessarily a causal difference between groups.

Worked Example: Group Contrast at and Away From the Center

Suppose a hypothetical fitted model predicts an exam score, in points, from study time \(X\), measured in hours, and tutoring status \(G\). Let \(G=0\) indicate no tutoring and \(G=1\) indicate tutoring, and center study time at \(c=10\) hours. The fitted model is

$$ \widehat{Y}=72+1.4(X-10)-3G+0.8(X-10)G. $$

The reference group’s fitted score at 10 hours is 72 points. The coefficient of \(G\), \(-3\), means that at 10 hours the fitted score for students receiving tutoring is 3 points lower than for students not receiving tutoring.

The no-tutoring slope is \(1.4\) points per additional study hour. The tutoring slope is \(1.4+0.8=2.2\) points per hour. The interaction estimate \(0.8\) means the fitted slope is 0.8 points per hour greater in the tutoring group.

At \(X=14\), the group contrast is

$$ -3+0.8(14-10)=-3+3.2=0.2\text{ points}. $$

Direct predictions check the result. For no tutoring, \(\widehat{Y}=72+1.4(4)=77.6\) points. For tutoring, \(\widehat{Y}=72+1.4(4)-3+0.8(4)=77.8\) points. Their difference is \(77.8-77.6=0.2\) points, as calculated. These fitted associations alone do not show that tutoring caused any score difference.

Changing the Centering Value

If the centering value changes, the numerical values of the intercept and group coefficient generally change because each refers to a different value of \(X\). The group-specific slopes and the fitted predictions at a given \(X\) do not change simply because of this re-expression. The following algebra shows exactly how the coefficients transform.

Suppose the model is centered at \(c\), and choose a new center \(c'=c+d\), where \(d\) is the shift in the centering value. Then \(X-c=(X-c')+d\). Substitute this into the original model and collect terms:

$$ \begin{aligned} Y &=\beta_0+\beta_1\{(X-c')+d\} +\beta_2G+\beta_3\{(X-c')+d\}G+\varepsilon\\ &=(\beta_0+d\beta_1)+\beta_1(X-c') +(\beta_2+d\beta_3)G+\beta_3(X-c')G+\varepsilon. \end{aligned} $$

Thus, under the new centering, the intercept is \(\beta_0+d\beta_1\), the group coefficient is \(\beta_2+d\beta_3\), and the two slope coefficients remain \(\beta_1\) and \(\beta_3\). The shifted intercept and group coefficient now refer to the new centering value. This is a re-expression of the same two fitted lines, not a change to the predictions.

Worked Example: Re-centering Changes the Group Contrast

Consider a hypothetical model for an outcome score \(Y\) and a quantitative predictor \(X\), measured in units. Let \(G=0\) be the reference group and \(G=1\) the comparison group. A model centered at \(c=20\) is

$$ \widehat{Y}=50+2(X-20)+4G-0.5(X-20)G. $$

At \(X=20\), the reference group’s fitted value is 50, and the comparison-minus-reference contrast is 4. The reference-group slope is 2 outcome units per unit of \(X\); the comparison-group slope is \(2-0.5=1.5\). The interaction indicates a slope difference of \(-0.5\) outcome units per unit of \(X\).

Now use \(c'=24\), so \(d=4\). The new intercept is \(50+4(2)=58\), and the new group coefficient is \(4+4(-0.5)=2\). The model becomes

$$ \widehat{Y}=58+2(X-24)+2G-0.5(X-24)G. $$

The new group coefficient, 2, is the contrast at \(X=24\), not at \(X=20\). Check the predictions at \(X=28\). The original model gives a reference prediction \(50+2(8)=66\) and a comparison prediction \(50+2(8)+4-0.5(8)=66\). The re-centered model gives \(58+2(4)=66\) and \(58+2(4)+2-0.5(4)=66\). Both models produce the same group predictions. The contrast at \(X=28\) is zero in either model.

A Practical Interpretation Sequence

When reading a centered interaction output, first identify which group is coded 0 and which is coded 1, then identify the centering value and its units. Interpret the coefficients in that order rather than reading each coefficient as if it described the entire sample.

1
Locate the reference value.
Read \(c\) from the definition of the centered predictor \(X-c\). At this value, the centered predictor is zero.
2
Interpret the group contrast.
The group coefficient \(\beta_2\) is the fitted comparison-minus-reference difference at \(X=c\), measured in outcome units.
3
Interpret both slopes.
The reference slope is \(\beta_1\), and the comparison slope is \(\beta_1+\beta_3\), in outcome units per unit of \(X\).
4
Evaluate a contrast at another \(X\), if needed.
Use \(\beta_2+\beta_3(X-c)\). Keep the subtraction in the stated units of \(X\).

For a fitted model, use the corresponding estimates \(b_0,b_1,b_2,b_3\). When reporting, include the group labels, the centering value, and the relevant units. A coefficient is not interpretable in isolation from the coding and units that define it.

Common Mistakes and Why the Centering Point Matters

  • Calling \(\beta_2\) the overall group difference. It is the group contrast specifically at \(X=c\). At another value of \(X\), use \(\beta_2+\beta_3(X-c)\).
  • Calling \(\beta_3\) a group difference in outcome. It is the difference in slopes, measured in outcome units per unit of \(X\). The outcome contrast at a particular \(X\) is calculated separately.
  • Adding the interaction estimate to the group coefficient to get a slope. The reference slope is \(\beta_1\); the comparison slope is \(\beta_1+\beta_3\). The group coefficient concerns the contrast at \(X=c\), not either group’s slope.
  • Assuming centering changes the fitted relationship. Centering changes the reference point and the associated intercept and group contrast. With the same model terms, it does not change the group-specific slopes or fitted predictions.
  • Reversing the group contrast. With the stated coding, contrasts are comparison group minus reference group. Reversing the subtraction reverses the sign.

Choosing a meaningful \(c\) makes the group comparison easier to communicate. It might be a typical predictor value or a value of practical interest, provided it is relevant to the data and question. But centering does not make a poorly supported comparison reliable: if the chosen value is far outside the observed range, the contrast there may depend on extrapolation.

Check Your Understanding

For each question, use the convention that the reference group has \(G=0\) and the comparison group has \(G=1\).

  1. In \(Y=\beta_0+\beta_1(X-c)+\beta_2G+\beta_3(X-c)G+\varepsilon\), what does \(\beta_2\) compare, and at what value of \(X\)?
  2. If \(\beta_1=1.1\) and \(\beta_3=-0.4\), what are the reference-group and comparison-group slopes? State the units if \(Y\) is measured in points and \(X\) in hours.
  3. For \(c=12\), \(\beta_2=3\), and \(\beta_3=0.5\), calculate the comparison-minus-reference contrast at \(X=16\).
  4. Why can the group coefficient change when the centering value changes even though the fitted predictions remain the same?
  5. A fitted group coefficient is negative. What additional information is needed before concluding that the comparison group has a lower fitted outcome at a particular predictor value?
Clinical Biostats