Tutorials › Regression Analysis (Undergraduate) › When the Centered Intercept Equals the Mean Outcome

Units, Scaling, and Centering · Tutorial 157 of 991

When the Centered Intercept Equals the Mean Outcome

See how the least-squares residual condition makes the centered-model intercept equal to the sample mean outcome, and when that equality does not apply.

Intermediate 9 min read

What You'll Learn

  • State the additive ordinary least-squares model with an intercept and mean-centered predictors.
  • Derive the centered-intercept identity from the least-squares normal equation.
  • Distinguish the centered intercept from the intercept in a model using uncentered predictors.
  • Check the identity in a one-predictor and a multiple-predictor example.
  • Identify why centering every predictor at its sample mean matters for the result.
  • Recognize cases, such as omitting the intercept, where the identity need not hold.

Why the Centered Intercept Has a Special Meaning

An intercept in a regression model describes the fitted outcome when the predictors take their zero values. That interpretation can be awkward if zero is far from the predictor values in the data or has no useful meaning. Centering predictors changes the zero point: a centered predictor is zero at its sample mean. In an additive ordinary least-squares model with an intercept, centering every predictor at its sample mean gives the intercept a particularly simple value: the sample mean outcome.

This equality is an exact algebraic property of the least-squares fit under stated conditions. It does not say that the sample mean outcome is the true population intercept, nor that a regression model is a causal description. The point is about the fitted intercept in the observed sample.

The Model and the Centering Convention

Definition: For \(n\) observations and \(p\) predictors, an additive ordinary least-squares model with an intercept is \(y_i=b_0+\sum_{j=1}^{p}b_j x_{ij}+e_i\) for \(i=1,\ldots,n\). Here \(y_i\) is the observed outcome for observation \(i\), \(x_{ij}\) is its value on predictor \(j\), \(b_0,\ldots,b_p\) are fitted coefficients, and \(e_i\) is the residual. The least-squares fit chooses the coefficients to minimize the sum of squared residuals. Predictor \(j\) is centered at its sample mean by replacing \(x_{ij}\) with \(x_{ij}-\bar{x}_j\), where \(\bar{x}_j\) is the sample mean of that predictor among the observations used in the fit.

In the centered model, the fitted outcome is \(b_0+\sum_{j=1}^{p}b_j(x_{ij}-\bar{x}_j)\). The slopes \(b_j\) describe additive changes in the fitted outcome for a one-unit increase in the corresponding predictor, holding the other predictors fixed. The intercept \(b_0\) is the fitted outcome when every centered predictor is zero—that is, when each original predictor is at its own sample mean.

The key result assumes ordinary, unweighted least squares; an intercept is included; and each predictor is centered using its sample mean over the same observations that are included in the fit. No normality assumption is needed for this algebraic identity. If the predictor columns and intercept are linearly independent, the least-squares coefficient vector is unique. The identity for the intercept follows from the least-squares residual condition even without that extra uniqueness condition.

Deriving the Intercept Identity

Write the residual for observation \(i\) in the centered model as \(e_i=y_i-b_0-\sum_{j=1}^{p}b_j(x_{ij}-\bar{x}_j)\). The least-squares objective is the sum of these squared residuals. Since the model includes an intercept, minimizing this objective requires the residuals to sum to zero. This is the normal equation for the intercept.

$$ \sum_{i=1}^{n} e_i=0 $$

Substitute the centered-model residuals into that condition. For each predictor \(j\), its centered values sum to zero by the definition of the sample mean: \(\sum_{i=1}^{n}(x_{ij}-\bar{x}_j)=0\). Therefore, all predictor terms disappear from the sum of residuals, leaving the following calculation.

$$ \begin{aligned} 0 &=\sum_{i=1}^{n}\left[y_i-b_0-\sum_{j=1}^{p}b_j(x_{ij}-\bar{x}_j)\right]\\ &=\sum_{i=1}^{n}y_i-nb_0 -\sum_{j=1}^{p}b_j\sum_{i=1}^{n}(x_{ij}-\bar{x}_j)\\ &=\sum_{i=1}^{n}y_i-nb_0\\ &=n\bar{y}-nb_0. \end{aligned} $$

Since \(n\) is positive, dividing by \(n\) gives \(b_0=\bar{y}\). The derivation uses the sample means of the predictors in the fitted data, not a population mean or a mean from some different set of observations.

Theorem: In an additive, unweighted ordinary least-squares model that includes an intercept, if every predictor is centered at its sample mean over the fitted observations, then the fitted intercept is exactly the sample mean outcome: \(b_0=\bar{y}\). Equivalently, the fitted outcome at the point where all predictors are at their sample means is \(\bar{y}\).

Worked Examples

Worked Example: One Centered Predictor

Suppose a hypothetical sample records study hours \(x\) and quiz scores \(y\), measured in points, for four students. The predictor values are \(8,9,11,12\), and the scores are \(5,9,11,15\). Fit an additive least-squares line using study hours centered at their sample mean, and verify its intercept.

The means are \(\bar{x}=(8+9+11+12)/4=10\) hours and \(\bar{y}=(5+9+11+15)/4=10\) points. The centered predictor values are \(-2,-1,1,2\) hours. With one predictor, the least-squares slope is the sum of the products of the centered predictor and centered outcome divided by the sum of squared centered predictor values:

$$ b_1= \frac{(-2)(5-10)+(-1)(9-10)+(1)(11-10)+(2)(15-10)} {(-2)^2+(-1)^2+1^2+2^2} =\frac{10+1+1+10}{10} =2.2\text{ points per hour}. $$

The centered-model intercept is \(b_0=\bar{y}=10\) points. Thus the fitted line is \(\hat{y}=10+2.2(x-10)\), where \(x\) is in hours and \(\hat{y}\) is in points. At the sample mean of 10 study hours, the fitted score is 10 points, exactly the sample mean score.

For a direct check, the fitted scores at 8, 9, 11, and 12 hours are \(5.6,7.8,12.2,\) and \(14.4\) points. Their mean is \((5.6+7.8+12.2+14.4)/4=10\) points, consistent with the intercept identity. The values are hypothetical and illustrate the algebra, not an empirical finding.

Worked Example: Two Predictors Centered at Their Means

Consider this hypothetical dataset on four students. The predictors are weekly practice hours \(x_1\) and number of practice sessions \(x_2\); the outcome \(y\) is a quiz score in points.

Student\(x_1\) (hours)\(x_2\) (sessions)\(y\) (points)
A9312
B954
C11314
D11510

The predictor means are \(\bar{x}_1=(9+9+11+11)/4=10\) hours and \(\bar{x}_2=(3+5+3+5)/4=4\) sessions. The outcome mean is \(\bar{y}=(12+4+14+10)/4=10\) points. The centered predictor columns are \((-1,-1,1,1)\) hours and \((-1,1,-1,1)\) sessions. Their cross-product is zero, and each centered column has a sum of squares of 4.

Using the centered-predictor least-squares calculations, the practice-hours slope is \(b_1=\sum (x_{i1}-\bar{x}_1)(y_i-\bar{y})/\sum (x_{i1}-\bar{x}_1)^2\). Substitution gives \(((-1)(2)+(-1)(-6)+(1)(4)+(1)(0))/4=8/4=2\) points per hour. The sessions slope is \(b_2=\sum (x_{i2}-\bar{x}_2)(y_i-\bar{y})/\sum (x_{i2}-\bar{x}_2)^2\), giving \(((-1)(2)+(1)(-6)+(-1)(4)+(1)(0))/4=-12/4=-3\) points per session. Because the centered predictor columns are perpendicular in this dataset, these separate calculations give the slopes in the joint model as well.

The centered-model intercept is \(b_0=\bar{y}=10\) points. The fitted model is therefore \(\hat{y}=10+2(x_1-10)-3(x_2-4)\). At 10 practice hours and 4 sessions, both centered predictors are zero and the fitted score is 10 points. The negative sessions slope is a feature of this hypothetical dataset after accounting for practice hours; it should not be read as evidence that sessions cause lower scores.

Worked Example: Moving One Center Away From Its Mean

Use the same hypothetical four-student dataset, whose fitted centered model is \(\hat{y}=10+2(x_1-10)-3(x_2-4)\). Now center practice hours at 11 rather than its sample mean of 10, while keeping sessions centered at their sample mean of 4. What is the new intercept, and why is it not the sample mean score?

At the new zero point, \(x_1=11\) hours and \(x_2=4\) sessions. Substituting these values into the fitted model gives \(10+2(11-10)-3(4-4)=12\) points. Equivalently, if the centered variables are \(x_1-11\) and \(x_2-4\), the same fitted line is \(\hat{y}=12+2(x_1-11)-3(x_2-4)\). The intercept has increased by \(2(11-10)=2\) points, the hours slope multiplied by the one-hour shift in the reference point.

The new intercept is the fitted score at 11 hours and 4 sessions, not at the joint sample-mean predictor values. Since practice hours are no longer centered at their sample mean, the condition behind the identity \(b_0=\bar{y}\) is not met. The sample mean score remains 10 points.

What the Result Does—and Does Not—Say

With uncentered predictors, the intercept usually differs from the sample mean outcome. In an additive least-squares model with an intercept and the same fitted observations, the residuals still sum to zero. Applying that condition without centering gives \(\bar{y}=b_0+\sum_{j=1}^{p}b_j\bar{x}_j\), or \(b_0=\bar{y}-\sum_{j=1}^{p}b_j\bar{x}_j\). Centering each predictor at its sample mean makes every \(\bar{x}_j\) in this expression zero, leaving \(b_0=\bar{y}\). This is a statement about the fitted model; it does not change the observed outcome mean.

The result matters because it gives the intercept a clear data-based reference point. When all predictors are mean-centered, the intercept is the fitted outcome for a combination of predictor values located at their respective sample means. This can make the intercept easier to interpret than a prediction at zero hours, zero age, or another potentially irrelevant zero. In an additive model, the equality also provides a simple check on a calculated fit or a software output.

  • The outcome mean and the predictor means must be computed from the same observations used in the fit.
  • Every predictor in the model must be centered at its own sample mean for this exact identity to follow.
  • The model must include an intercept and use ordinary, unweighted least squares.
  • The equality does not say the intercept is a population parameter equal to the observed sample mean, or establish a causal relationship.

Common Mistake

A common mistake is to conclude that the intercept always equals \(\bar{y}\) whenever an ordinary least-squares model includes an intercept. The residuals-sum-to-zero condition alone does not imply that: in an uncentered model, the predictor terms contribute \(n\sum_j b_j\bar{x}_j\) to the sum of fitted values. The correction is to check the predictor reference values. The intercept equals \(\bar{y}\) when all predictors are centered at their sample means in the fitted sample; otherwise, it represents the fitted outcome when the predictors are zero on their current scales.

A related mistake is to treat this result as true for a model without an intercept. The least-squares normal equation for an intercept is unavailable when no intercept is fitted, so the residuals need not sum to zero and the identity is not guaranteed. Likewise, fitting with weights changes the relevant least-squares conditions; the ordinary sample means in this tutorial cannot automatically be substituted for the corresponding weighted quantities.

Key takeaway: In an additive ordinary least-squares model with an intercept, centering every predictor at its mean in the fitted sample makes the fitted intercept exactly \(\bar{y}\). The identity follows because centered predictor columns sum to zero and the least-squares residuals sum to zero.

Check Your Understanding

Use the model conditions and the residual-sum argument to answer these questions.

  1. A model includes an intercept and two predictors, each centered at its mean over the fitted observations. What is the fitted intercept, and what predictor values does it correspond to?
  2. In the derivation, why does each centered-predictor term disappear when the residuals are summed?
  3. A predictor is centered at a fixed reference value that is not its sample mean, while all other predictors are centered at their sample means. Is the intercept necessarily the sample mean outcome? Explain.
  4. For an uncentered additive least-squares model with an intercept, write the relationship between \(b_0\), \(\bar{y}\), the slopes, and the predictor means.
  5. Why does the centered-intercept identity not automatically apply to a least-squares model that omits the intercept?