Why Center a Predictor in an Interaction Model?
In a factor-by-continuous interaction model, the coefficient for a factor describes a comparison at a particular value of the continuous predictor: the value coded as zero. If zero is far outside the data or has no useful scientific meaning, that comparison can be hard to interpret. Centering replaces zero with a chosen reference value, such as a clinically meaningful measurement or the sample mean.
Centering is a change of coordinates, not a change to the modeled relationship. The factor-specific slopes, their differences, and the fitted linear predictors can all be preserved. What changes is the interpretation—and numerical value—of the intercept and factor main-effect coefficients.
Coefficient Transformation
Consider a GLM with link function \(g\), where \(g(\mu_i)=\eta_i\). Let \(z_i\) be a vector of coded columns for a factor, and let \(x_i\) be a continuous predictor. A factor-by-continuous interaction model can be written as
Here \(\alpha\) is the intercept, \(\gamma\) contains factor main-effect coefficients, \(\beta\) is the continuous-predictor coefficient for the reference factor profile, and \(\delta\) contains interaction coefficients. For a binary factor under reference coding, \(z_i\) is a single indicator: it is zero for the reference group and one for the other group.
Since \(x_i=x_{c,i}+c\), substitution gives
Thus the centered coefficients are \(\alpha_c=\alpha+c\beta\), \(\gamma_c=\gamma+c\delta\), \(\beta_c=\beta\), and \(\delta_c=\delta\). In particular, the factor main-effect coefficients generally change because the factor comparison is now evaluated at \(x=c\). The interaction coefficients do not change.
Worked Example: Centering a Binary-Factor Model
Suppose a Gaussian identity-link model with binary factor \(A\) is
Center \(x\) at \(c=5\), so \(x_c=x-5\) and \(x=x_c+5\). Substitution gives
The intercept changes from \(10\) to \(20\). The factor coefficient changes from \(4\) to \(19=4+3(5)\). The slope coefficient \(2\) and interaction coefficient \(3\) are unchanged.
Check the fitted linear predictors at \(x=7\), for which \(x_c=2\). For \(A=0\), the original predictor is \(10+2(7)=24\), and the centered predictor is \(20+2(2)=24\). For \(A=1\), the original predictor is \(10+4+2(7)+3(7)=49\), and the centered predictor is \(20+19+2(2)+3(2)=49\).
The reference-group slope is \(2\), while the \(A=1\) slope is \(2+3=5\); their difference is \(3\). The main-effect coefficient \(19\) is the difference between the groups’ linear predictors specifically at \(x=5\), not at \(x=0\).
What the Coefficients Mean After Centering
Under reference coding, the reference group has \(z_i=0\), so its linear predictor is \(\alpha+\beta x_i\). A group represented by \(z_i\) has linear predictor \(\alpha+z_i^{\mathsf T}\gamma+(\beta+z_i^{\mathsf T}\delta)x_i\). Its slope is therefore \(\beta+z_i^{\mathsf T}\delta\), and the slope difference from the reference group is \(z_i^{\mathsf T}\delta\).
At the centering value \(x_i=c\), the difference between that group’s and the reference group’s linear predictors is \(z_i^{\mathsf T}(\gamma+c\delta)\). This is why the centered factor coefficient is \(\gamma+c\delta\): it describes the factor contrast at the chosen reference point on the linear-predictor scale. In a logistic model, for example, this is a contrast in log odds, not a constant difference in probabilities.
Worked Example: Centering in a Logistic Interaction Model
Suppose a logistic regression has the linear predictor
where \(A=0\) is the reference group. Center at \(c=10\), so \(x_c=x-10\). Substituting \(x=x_c+10\) yields
The factor coefficient is now \(-1.4\), the log-odds contrast between groups at \(x=10\). For a direct check at \(x=12\), \(x_c=2\). When \(A=0\), both forms give \(\eta=-2+0.4(12)=2+0.4(2)=2.8\). When \(A=1\), both give \(\eta=-2+0.6+0.4(12)-0.2(12)=1.0\) and \(\eta=2-1.4+0.4(2)-0.2(2)=1.0\).
The corresponding probabilities are \(1/(1+e^{-2.8})\approx0.943\) for \(A=0\) and \(1/(1+e^{-1})\approx0.731\) for \(A=1\). The reference-group slope on the log-odds scale is \(0.4\); the other group’s is \(0.4-0.2=0.2\). The slope difference, \(-0.2\), is unchanged by centering.
Why the Fitted Linear Predictors Are Preserved
Proof. By definition, \(x_i=x_{c,i}+c\). Substituting this identity into the original predictor and collecting terms gives
The final expression is precisely the centered model with the stated transformed coefficients. It equals the original \(\eta_i\) for each observation. Therefore the model’s implied mean, as specified by its link, is also unchanged. The transformation is reversible: \(\alpha=\alpha_c-c\beta_c\) and \(\gamma=\gamma_c-c\delta_c\), while \(\beta=\beta_c\) and \(\delta=\delta_c\). Thus centering re-expresses the same linear predictors rather than restricting the model. \(\square\)
This equality also explains why fitting the same GLM with \(x\) or \(x_c\) gives the same attainable fitted linear predictors, provided the model includes the same factor terms and interactions and the coefficient space is unrestricted. The statement is about reparameterization; it does not assert that numerical algorithms must follow identical computational paths.
Derivation. For factor code \(z\), the coefficient of \(x_i\) in its linear predictor is \(\beta+z^{\mathsf T}\delta\). After centering, the coefficient of \(x_{c,i}\) is \(\beta_c+z^{\mathsf T}\delta_c=\beta+z^{\mathsf T}\delta\). For two factor profiles \(z_a\) and \(z_b\), their slope difference is
The centered model has the same expression because \(\delta_c=\delta\). Hence both slopes and their difference are preserved. \(\square\)
Worked Example: A Three-Level Factor
Let \(A\) be the reference level and let \(B\) and \(C\) be indicator variables for the other two levels. Suppose
Center at \(c=4\), giving \(x_c=x-4\). The transformed coefficients are: intercept \(1+2(4)=9\); \(B\) main effect \(0.5+0.3(4)=1.7\); \(C\) main effect \(-1-0.4(4)=-2.6\). The continuous slope coefficient remains \(2\), and the interaction coefficients remain \(0.3\) and \(-0.4\). Thus
The slopes for levels \(A\), \(B\), and \(C\) are \(2\), \(2+0.3=2.3\), and \(2-0.4=1.6\), respectively. Their differences from \(A\) remain \(0.3\) and \(-0.4\). To check a fitted value, take level \(C\) at \(x=5\), so \(C=1\) and \(x_c=1\). The original predictor is \(1-1+2(5)-0.4(5)=8\); the centered predictor is \(9-2.6+2(1)-0.4(1)=8\).
Common Mistake and Practical Use
A frequent error is to update only the intercept when centering, while leaving the factor main-effect coefficients unchanged. That misses the contribution of the interaction at the new zero point. In the binary-factor example, changing the intercept from \(10\) to \(20\) but keeping the factor coefficient at \(4\) would claim that the groups differ by \(4\) at \(x=5\). The actual difference there is \(4+3(5)=19\). The correct centered factor coefficient must include the interaction coefficient multiplied by the centering constant.
Centering is useful when zero is not a meaningful predictor value, when a comparison at a scientifically relevant value is desired, or when a predictor’s numerical scale makes the intercept difficult to read. It does not remove the interaction, change the link, or make the factor contrast constant across values of \(x\). It simply states the main effects at a different reference value.
Check Your Understanding
Use the coefficient transformation and verify your conclusions on the linear-predictor scale.
- For \(\eta=3+2A+5x-Ax\), center \(x\) at \(c=2\). What are the centered coefficients?
- In a factor-by-continuous interaction model, what contrast does the factor main-effect coefficient represent after centering at \(c\)?
- Does centering change the difference between the continuous slopes in two factor groups? Explain using the interaction coefficient.
- For the model \(\eta=-1+0.4B+2x+0.5Bx\), center at \(c=3\). Calculate the centered intercept and \(B\) main-effect coefficient.
- Why is it incorrect to adjust the intercept but leave the factor main effect unchanged when centering a predictor in an interaction model?