Why Center a Covariate in an Interaction Model?
In an analysis of covariance with a treatment-by-covariate interaction, each treatment group has its own fitted regression line. The intercept in the model is the fitted response for a group when the covariate equals zero. If zero is far outside the range of observed covariate values, that intercept may be difficult to interpret. Centering replaces the covariate with its difference from a chosen reference value, so the intercepts instead describe fitted responses at that value.
Centering is a change of coordinates, not a change to the model’s predictions. It does not make the group slopes more alike, remove an interaction, or alter the test of slope homogeneity. The key is to keep track of which coefficients change and which do not.
The Interaction Model and Its Centered Form
Suppose there are \(G\) treatment groups, and choose group 1 as the reference group. Let \(Y_{ij}\) be the response for observation \(j\) in group \(i\), and let \(x_{ij}\) be its covariate value. One useful treatment-coded model is
Here \(I_{ijg}=1\) if the observation is in group \(g\), and is 0 otherwise. The reference group has intercept \(\beta_0\) and slope \(\beta_1\). Group \(g\) has intercept \(\beta_0+\gamma_g\) and slope \(\beta_1+\delta_g\). Thus \(\gamma_g\) and \(\delta_g\) are differences from the reference group’s intercept and slope, respectively.
For the usual partial F test of slope homogeneity, the null hypothesis is that all groups have the same slope. In this coding, it is \(H_0:\delta_2=\cdots=\delta_G=0\). The alternative is that at least one of these slope differences is nonzero. This test compares the interaction model with a reduced model that retains the group intercept terms and covariate term but omits the interaction terms.
Substitute \(x_{ij}=x^c_{ij}+c\) into the original model and collect the constant and covariate terms. The resulting coefficients are
Consequently, the centered reference-group line has intercept \(\beta_0^c\) and slope \(\beta_1^c\); group \(g\) has intercept \(\beta_0^c+\gamma_g^c\) and slope \(\beta_1^c+\delta_g^c\). Each group’s slope is unchanged. The treatment-specific intercept terms generally change because they now describe fitted responses at \(x=c\), rather than at \(x=0\).
Why Fitted Values Are Unchanged
The invariance follows directly from substitution. In the original model, the reference-group contribution is \(\beta_0+\beta_1x\). In centered coordinates it is
For group \(g\), the original line is \((\beta_0+\gamma_g)+(\beta_1+\delta_g)x\). The centered line gives
So for every observation, the fitted response is identical under the two parameterizations. The observed response has not changed either, so each residual, and therefore the residual sum of squares, is identical. This algebra is a reparameterization: it does not depend on a particular dataset.
Worked Example: Reinterpreting Group Intercepts
Worked Example: Reinterpreting Group Intercepts
Suppose a hypothetical ANCOVA has two treatment groups, Control and Treatment, and a response measured in score points. The covariate \(x\), measured in baseline score points, has fitted lines
The Treatment group’s slope is \(1.5\) response points per baseline point, compared with \(2\) for Control. Center at \(c=10\) baseline points, so \(x^c=x-10\). For Control, the new intercept is \(20+2(10)=40\), and its slope stays \(2\). For Treatment, the new intercept is \(26+1.5(10)=41\), and its slope stays \(1.5\). The centered lines are therefore
The original intercepts, 20 and 26, are fitted responses at \(x=0\). The centered intercepts, 40 and 41, are fitted responses at \(x=10\). For example, at \(x=8\), \(x^c=-2\). The centered Control prediction is \(40+2(-2)=36\), matching \(20+2(8)=36\). The Treatment prediction is \(41+1.5(-2)=38\), matching \(26+1.5(8)=38\). The predictions and slopes are unchanged; only the covariate value represented by the intercept has changed.
For this interpretation to be used as a regression model, the usual assumptions must be appropriate: the mean response is linear within each group over the covariate range, errors are independent with mean zero and a common variance, and errors are normally distributed for exact small-sample F inference. These hypothetical fitted lines alone cannot establish those assumptions. They would need to be assessed using the study design and residual diagnostics.
The Slope-Homogeneity Test Is Unchanged
In centered coordinates, the slope-difference parameters remain \(\delta_g^c=\delta_g\). Thus the null hypothesis of equal slopes is still \(H_0:\delta_2^c=\cdots=\delta_G^c=0\). There is also a direct model-comparison reason for the same result: the full model and the reduced common-slope model each allow their group intercepts to be re-expressed at \(x=c\). Neither model’s fitted values or residual sum of squares changes, and the number of fitted parameters in each model is the same.
The partial F statistic for comparing the reduced model with the interaction model is
where \(SSE_R\) and \(SSE_F\) are the residual sums of squares for the reduced and full models, \(q\) is the number of added interaction parameters, and \(df_F\) is the full model’s residual degrees of freedom. Since centering leaves both residual sums of squares and the degrees of freedom unchanged, it leaves \(F\), its reference distribution under \(H_0\), and its p-value unchanged. This exact F test relies on the usual regression conditions: independent errors, a correctly specified linear mean model, constant error variance, and normally distributed errors for exact inference.
Worked Example: Verifying the Test Is Unchanged
Consider hypothetical software results for three treatment groups. The interaction model has \(SSE_F=120\) and \(df_F=36\). The common-slope model has \(SSE_R=150\), so the interaction adds \(q=2\) slope parameters. The partial F statistic is
Under the null hypothesis of equal slopes, this is compared with an \(F\) distribution with 2 and 36 degrees of freedom. Its upper-tail p-value is approximately \(0.0180\). At significance level \(\alpha=0.05\), the result is evidence against equal slopes in this hypothetical analysis.
Now center the covariate at any constant \(c\). The full and reduced models are merely re-expressed: their fitted values remain the same, so their residual sums of squares remain 120 and 150. The parameter counts, \(q=2\), and full-model residual degrees of freedom, 36, also remain the same. Substitution therefore gives the same \(F=4.500\) and p-value of approximately \(0.0180\). The conclusion about the slope-homogeneity test does not depend on the centering constant.
These reported sums of squares are hypothetical model results, not raw observations. To use the exact reference distribution in practice, the independent-error, common-variance, linear-mean, and normal-error conditions must be reasonable; centering neither establishes nor repairs them.
Choosing a Centering Constant
A useful \(c\) is often a covariate value with a clear meaning and adequate representation in the data. For example, zero might mean “no baseline measurement,” while a clinical or educational scale may have a more useful reference value near the middle of the observed range. The sample mean of the covariate is another common choice. In every case, state the value and units: centering at 10 baseline points gives a different intercept interpretation from centering at 10 years of age.
If a sample has covariate values 6, 8, 10, 12, and 14 points, their mean is \((6+8+10+12+14)/5=10\) points. Centering at that mean makes \(x^c=0\) correspond to an observed-range reference value of 10 points. It does not mean every treatment group has mean covariate value 10, particularly if group sizes or covariate distributions differ. The chosen constant is a reference for the model’s intercepts, not a claim about the covariate value of every group.
Centering may make intercepts easier to interpret and can reduce numerical awkwardness when covariate values are large. It does not alter the data, change the unit of the covariate, or remove the interaction. In particular, if group slopes differ, they still differ by exactly the same amounts after centering.
Common Mistakes
- Thinking centering changes the slopes. It changes the covariate origin, not its unit or the rate of change. The slope coefficients are unchanged.
- Interpreting a centered intercept at the wrong covariate value. When \(x^c=x-c\), the centered intercept refers to original \(x=c\), not to original \(x=0\).
- Expecting the interaction test to change. Centering changes the intercept parameterization, but preserves fitted values and residual sums of squares in both nested models. The partial F test is unchanged.
- Treating centering as a way to make lines parallel. It cannot remove a treatment-by-covariate interaction. Equal slopes remain a substantive model condition that must be assessed.
- Choosing a reference point without considering its meaning. An intercept at a covariate value far outside the observed range can be an extrapolated quantity, even after centering. Choose and report \(c\) thoughtfully.
Check Your Understanding
Use the model definitions and results above to answer these questions.
- A group has fitted line \(\widehat{Y}=12+0.8x\). Write its line after centering at \(c=5\), and state what the new intercept represents.
- In a treatment-coded interaction model, which parameters represent slope differences from the reference group? What happens to them when the covariate is centered?
- Explain why centering leaves the partial F statistic for slope homogeneity unchanged.
- If a covariate is centered at its overall sample mean, must that value equal the sample mean within each treatment group? Explain.
- Does centering make a model with nonparallel fitted lines have parallel lines? Why or why not?