Tutorials › Generalized Linear Models › Centering Predictors and Interpreting Intercepts

Design Matrices and Predictors · Tutorial 95 of 981

Centering Predictors and Interpreting Intercepts

Learn how centering numerical predictors changes the intercept but preserves every fitted linear predictor.

Beginner 9 min read

What You'll Learn

  • Define a centered predictor using its sample mean
  • Derive the intercept and coefficient transformation for one predictor
  • Extend the transformation to several numerical predictors
  • Verify that centering preserves fitted linear predictors
  • Interpret a centered intercept in the context of other predictors

Why Center a Predictor?

A numerical predictor is often measured from a convenient zero that is not typical of the observations. For example, age may be recorded in years even when the observed ages are all near 50. In a model with an intercept, centering age at its sample mean changes the reference point for the intercept: it describes the linear predictor at the average age rather than at age zero. The central algebraic fact is that this change of reference point does not change the fitted linear predictors.

Centering is a change in how the same linear predictor is represented, not a new predictor effect. We will derive the exact coefficient transformation, check it numerically, and distinguish the intercept’s linear-predictor meaning from a response-scale interpretation.

Definition: For observed numerical predictor values \(x_1,\ldots,x_n\), their sample mean is \(\bar{x}=\frac{1}{n}\sum_{i=1}^n x_i\). The centered predictor for observation \(i\) is \(x_{ci}=x_i-\bar{x}\). Its sample mean is zero, since \(\frac{1}{n}\sum_{i=1}^n x_{ci}=\frac{1}{n}\sum_{i=1}^n(x_i-\bar{x})=\bar{x}-\bar{x}=0\).

One Numerical Predictor

Suppose a model includes an intercept and one numerical predictor, with linear predictor \(\eta_i=\beta_0+\beta_1x_i\). Write \(x_i=x_{ci}+\bar{x}\) and substitute:

$$ \eta_i=\beta_0+\beta_1(x_{ci}+\bar{x}) =(\beta_0+\beta_1\bar{x})+\beta_1x_{ci}. $$

Thus the centered representation has the same slope and a changed intercept. The new intercept is the old linear predictor evaluated at the predictor mean, because when \(x_i=\bar{x}\), the centered value is zero.

Result: If \(\eta_i=\beta_0+\beta_1x_i\) and \(x_{ci}=x_i-\bar{x}\), then the identical linear predictor can be written as \(\eta_i=\beta_{0c}+\beta_{1c}x_{ci}\), where \(\beta_{0c}=\beta_0+\beta_1\bar{x}\) and \(\beta_{1c}=\beta_1\). The centered intercept \(\beta_{0c}\) is the linear predictor at \(x=\bar{x}\).

Worked Example: Centering a Predictor by Hand

Suppose three observed predictor values are \(2,4,6\), and the linear predictor is \(\eta_i=1.5+0.8x_i\). Find the centered values and the coefficients in the centered representation, then check the fitted values.

Find the mean and centered values. The mean is \(\bar{x}=(2+4+6)/3=4\). Therefore the centered values are \(2-4=-2\), \(4-4=0\), and \(6-4=2\).

Transform the coefficients. The centered intercept is \(1.5+0.8(4)=4.7\), and the centered slope remains \(0.8\). Thus \(\eta_i=4.7+0.8x_{ci}\).

Check each observation. For \(x=2\), the original calculation gives \(1.5+0.8(2)=3.1\), while the centered calculation gives \(4.7+0.8(-2)=3.1\). For \(x=4\), both give \(4.7\). For \(x=6\), both give \(6.3\). The linear predictors agree observation by observation.

Several Numerical Predictors

The same operation applies when the model contains several numerical predictors. Let \(\eta_i=\beta_0+\sum_{j=1}^{p}\beta_jx_{ij}\), where \(x_{ij}\) is predictor \(j\) for observation \(i\). Center each predictor at its own sample mean, \(x_{cij}=x_{ij}-\bar{x}_j\). Substituting \(x_{ij}=x_{cij}+\bar{x}_j\) gives:

$$ \eta_i= \left(\beta_0+\sum_{j=1}^{p}\beta_j\bar{x}_j\right) +\sum_{j=1}^{p}\beta_jx_{cij}. $$

All slopes remain unchanged; the intercept increases by the sum of each slope multiplied by its predictor mean. The new intercept is the linear predictor at the point where every centered predictor is zero, meaning the vector of predictor values is \((\bar{x}_1,\ldots,\bar{x}_p)\). That point need not correspond to an actual observation.

Worked Example: Centering Two Predictors

A linear predictor is \(\eta_i=-2+0.03a_i+0.4e_i\), where \(a_i\) is age and \(e_i\) is an exposure measure. In the observed data, \(\bar{a}=50\) and \(\bar{e}=3\). Find the centered representation and check it for an observation with age 60 and exposure 2.

Center both predictors. Define \(a_{ci}=a_i-50\) and \(e_{ci}=e_i-3\). The new intercept is \(-2+0.03(50)+0.4(3)=-2+1.5+1.2=0.7\). The slopes remain \(0.03\) and \(0.4\), so \(\eta_i=0.7+0.03a_{ci}+0.4e_{ci}\).

Check the specified observation. In the original representation, \(\eta_i=-2+0.03(60)+0.4(2)=-2+1.8+0.8=0.6\). Its centered values are \(a_{ci}=60-50=10\) and \(e_{ci}=2-3=-1\). The centered representation gives \(0.7+0.03(10)+0.4(-1)=0.7+0.3-0.4=0.6\), as required.

At the predictor means, both centered values are zero and the linear predictor is \(0.7\). In the original representation, the same calculation is \(-2+0.03(50)+0.4(3)=0.7\).

Why the Fitted Linear Predictors Are Preserved

The preceding substitution gives the transformation directly. The next result makes its scope explicit: for a model with an intercept, centering numerical predictors changes the coefficient coordinates but leaves every possible vector of linear predictors available in the model unchanged.

Theorem: Consider the model \(\eta_i=\beta_0+\sum_{j=1}^{p}\beta_jx_{ij}\), with fixed predictor values and an intercept. Define \(x_{cij}=x_{ij}-\bar{x}_j\). For every coefficient vector \((\beta_0,\beta_1,\ldots,\beta_p)\), there is a centered coefficient vector producing the same \(\eta_i\) for every observation. Conversely, every centered coefficient vector corresponds to exactly one original coefficient vector.

Proof. Define \(\beta_{jc}=\beta_j\) for \(j=1,\ldots,p\), and define \(\beta_{0c}=\beta_0+\sum_{j=1}^{p}\beta_j\bar{x}_j\). Since \(x_{ij}=x_{cij}+\bar{x}_j\), for every observation \(i\),

$$ \beta_0+\sum_{j=1}^{p}\beta_jx_{ij} =\beta_0+\sum_{j=1}^{p}\beta_j(x_{cij}+\bar{x}_j) =\beta_{0c}+\sum_{j=1}^{p}\beta_{jc}x_{cij}. $$

This proves that the transformed coefficients yield the same linear predictors. To show the correspondence is reversible, start with any centered coefficients and set \(\beta_j=\beta_{jc}\) for each \(j\), and \(\beta_0=\beta_{0c}-\sum_{j=1}^{p}\beta_{jc}\bar{x}_j\). Substitution recovers the centered coefficients. The forward and reverse transformations are therefore inverses, so the correspondence is one-to-one. \(\square\)

This result is about the linear predictor. In a GLM, the model’s other ingredients act on that predictor, so a re-expression that gives the same \(\eta_i\) for every observation also preserves whatever model quantities are determined by those linear predictors. In particular, centering alone does not change the model’s fitted linear predictors.

Worked Example: Interpreting a Centered Intercept With a Group Indicator

Suppose \(\eta_i=-18+0.5a_i+1.2z_i\), where \(a_i\) is age and \(z_i\) is a group indicator coded 0 or 1. The mean age is 40. Center age, leaving the indicator unchanged, and interpret the new intercept.

Rewrite the age term. Let \(a_{ci}=a_i-40\), so \(a_i=a_{ci}+40\). Then \(-18+0.5(a_{ci}+40)+1.2z_i=(-18+20)+0.5a_{ci}+1.2z_i=2+0.5a_{ci}+1.2z_i\).

The centered intercept \(2\) is the linear predictor for age 40 and \(z=0\). It is not the linear predictor for age 40 in both groups: for \(z=1\), the linear predictor at age 40 is \(2+1.2=3.2\). The indicator’s contribution remains in the model, so the intercept interpretation specifies its reference category.

Check an observation. At age 44 and \(z=1\), the original representation gives \(-18+0.5(44)+1.2=5.2\). The centered representation gives \(2+0.5(44-40)+1.2=2+2+1.2=5.2\).

What Centering Does—and Does Not—Say

Centering is useful because an intercept at a typical predictor value can be easier to describe than one at zero, particularly when zero is far outside the observed range. It can also make the intercept’s reference point explicit in a model with several numerical predictors: when all are centered, the intercept is the linear predictor at their joint sample-mean point, with any other predictors held at their specified reference values.

The intercept remains a value on the linear-predictor scale. It should not automatically be described as a mean response. Its relation to the response depends on the model’s link and other specifications. Likewise, the joint mean point can be mathematically well-defined even if no individual in the data has exactly that combination of predictor values.

Common mistake: “Centering changes the predictor values, so it must change the fitted linear predictors or the slope.” The correction is to substitute \(x_i=x_{ci}+\bar{x}\) into the original expression. This gives \(\eta_i=(\beta_0+\beta_1\bar{x})+\beta_1x_{ci}\): the slope is unchanged, the intercept is adjusted, and the fitted linear predictor is identical for each observation. Omitting the intercept adjustment is what would generally change the fitted values.

Centering is defined relative to a chosen reference value. The sample mean is common, but the same algebra works if a different constant \(c\) is chosen and \(x_{ci}=x_i-c\): the centered intercept becomes \(\beta_0+\beta_1c\). The choice of reference affects the interpretation of the intercept, not the slope or the represented linear predictors. This is centering, not a change in the predictor’s units.

Check Your Understanding

Use the coefficient substitutions and check what each intercept represents.

  1. A model has \(\eta_i=3-0.2x_i\), and \(\bar{x}=10\). What are the centered intercept and slope?
  2. For \(\eta_i=1+2x_i-3w_i\), the sample means are \(\bar{x}=4\) and \(\bar{w}=2\). Write the model using both centered predictors.
  3. Why does centering a predictor without changing the intercept generally fail to preserve the linear predictors?
  4. In a model with a centered numerical predictor and a group indicator, what additional condition may be needed to interpret the intercept?
  5. Does centering a predictor change its units? Explain the distinction between centering and rescaling.
Clinical Biostats