Tutorials › Introduction to Statistics › Why the Fitted Line Passes Through the Mean Point

Least-Squares Regression Lines · Tutorial 262 of 996

Why the Fitted Line Passes Through the Mean Point

Learn how the least-squares equations guarantee that the fitted response at the mean explanatory value equals the mean response.

Beginner 10 min read

What You'll Learn

  • State the mean point for paired quantitative data.
  • Derive the intercept equation from the least-squares condition on residuals.
  • Show algebraically that the fitted line contains \((\bar{x},\bar{y})\).
  • Verify the property using raw data and a supplied fitted slope.
  • Distinguish the mean point from an observed data point.
  • Recognize why the result does not require normality or a perfect linear pattern.

Introduction

A fitted regression line summarizes how a response variable changes with an explanatory variable. One precise fact about the least-squares line is that it always passes through the point whose coordinates are the two sample means, \((\bar{x},\bar{y})\). This is not an extra condition imposed after the line is fitted; it follows from the equations that define the least-squares line.

The property is useful as a check on calculations and as a way to understand the intercept. It also has limits: the mean point need not be one of the observed data points, and the fact that the line passes through it does not mean the line fits every observation closely.

Definition: For \(n\) paired observations \((x_i,y_i)\), the mean point is the point \((\bar{x},\bar{y})\), where \(\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i\) and \(\bar{y}=\frac{1}{n}\sum_{i=1}^{n}y_i\). A least-squares regression line has the form \(\hat{y}=b_0+b_1x\), where \(b_0\) is its intercept and \(b_1\) is its slope. The fitted response at \(x\) is \(\hat{y}\).

The Intercept Equation Gives the Result

For paired quantitative data with variation in \(x\), the usual least-squares regression line has slope \(b_1\) and intercept

$$ b_0=\bar{y}-b_1\bar{x}. $$

Substitute \(x=\bar{x}\) into the fitted-line equation. The fitted response is

$$ \hat{y}=b_0+b_1\bar{x} =(\bar{y}-b_1\bar{x})+b_1\bar{x} =\bar{y}. $$

Therefore, \((\bar{x},\bar{y})\) is on the fitted line. The slope terms cancel: the intercept is positioned exactly so that the line’s fitted response at the mean explanatory value is the mean response.

The equation for the intercept is part of the least-squares equations. A short derivation shows why it holds. For a proposed intercept and slope, the sum of squared residuals is

$$ S(b_0,b_1)=\sum_{i=1}^{n}\left[y_i-(b_0+b_1x_i)\right]^2. $$

At the least-squares fit, this quantity is minimized. Holding the fitted slope fixed and differentiating with respect to the intercept gives

$$ \frac{\partial S}{\partial b_0} =-2\sum_{i=1}^{n}\left[y_i-(b_0+b_1x_i)\right]. $$

At a minimizing intercept, this derivative is zero. Thus the residuals \(e_i=y_i-(b_0+b_1x_i)\) sum to zero:

$$ \sum_{i=1}^{n}e_i=0 \quad\Longrightarrow\quad \sum_{i=1}^{n}y_i-nb_0-b_1\sum_{i=1}^{n}x_i=0. $$

Divide by \(n\) and use the definitions of the sample means:

$$ \bar{y}-b_0-b_1\bar{x}=0 \quad\Longrightarrow\quad b_0=\bar{y}-b_1\bar{x}. $$

This establishes the intercept equation and, by substitution, the mean-point property. This algebraic result concerns the least-squares fit to the observed pairs. It does not require a normally distributed response or a perfect linear relationship. For the usual uniquely calculated slope, the \(x\)-values must have nonzero variation.

Worked Examples

Worked Example: Calculating the Mean Point From Raw Data

Suppose a hypothetical data set records \(x\) and \(y\) for three units: \((1,2)\), \((2,3)\), and \((3,5)\). Find the least-squares line and verify that it passes through the mean point.

First calculate both sample means:

$$ \bar{x}=\frac{1+2+3}{3}=2, \qquad \bar{y}=\frac{2+3+5}{3}=\frac{10}{3}\approx3.333. $$

The \(x\)-values vary, so the usual slope calculation is defined. The sum of products of deviations is

$$ \sum (x_i-\bar{x})(y_i-\bar{y}) =(-1)\left(-\frac{4}{3}\right) +(0)\left(-\frac{1}{3}\right) +(1)\left(\frac{5}{3}\right) =3. $$

The sum of squared deviations in \(x\) is \((-1)^2+0^2+1^2=2\), so the fitted slope is \(b_1=3/2=1.5\). Use the intercept equation:

$$ b_0=\bar{y}-b_1\bar{x} =\frac{10}{3}-\frac{3}{2}(2) =\frac{1}{3}\approx0.3333. $$

The fitted line is \(\hat{y}=\frac{1}{3}+\frac{3}{2}x\). At \(x=\bar{x}=2\),

$$ \hat{y}=\frac{1}{3}+\frac{3}{2}(2) =\frac{10}{3} =\bar{y}. $$

The line therefore passes through \((2,10/3)\). In this example, that mean point happens to match the observed pair \((2,3)\) only in its \(x\)-coordinate, not its \(y\)-coordinate; it is not itself an observed pair.

Worked Example: A Mean Point Need Not Be an Observation

A hypothetical exercise records study time \(x\), in hours, and quiz score \(y\), in points, for five students. The observed pairs are \((1,52)\), \((2,58)\), \((3,61)\), \((4,70)\), and \((5,74)\). Find the mean point and fitted line, then check the prediction at the mean study time.

The means are

$$ \bar{x}=\frac{1+2+3+4+5}{5}=3, \qquad \bar{y}=\frac{52+58+61+70+74}{5}=\frac{315}{5}=63. $$

To find the slope, the sum of products of deviations is

$$ (-2)(-11)+(-1)(-5)+(0)(-2)+(1)(7)+(2)(11) =22+5+0+7+22=56. $$

The sum of squared deviations in study time is \(4+1+0+1+4=10\), so \(b_1=56/10=5.6\) points per hour. The intercept is

$$ b_0=63-(5.6)(3)=46.2. $$

Thus the fitted line is \(\hat{y}=46.2+5.6x\), with quiz score in points and study time in hours. At the mean study time of 3 hours, its fitted score is

$$ \hat{y}=46.2+(5.6)(3)=46.2+16.8=63\text{ points}. $$

The line passes through the mean point \((3\text{ hours},63\text{ points})\). None of the recorded pairs is \((3,63)\): the student who studied 3 hours scored 61 points. The mean point summarizes the coordinates separately; it does not have to represent one particular student.

Worked Example: Checking the Property With Residuals

Consider hypothetical paired measurements \(x=10,20,30,40\), in minutes, and \(y=4,7,7,12\), in points. Verify the mean-point property and check that the residuals sum to zero.

The means are \(\bar{x}=(10+20+30+40)/4=25\) minutes and \(\bar{y}=(4+7+7+12)/4=7.5\) points. The sum of products of deviations is

$$ (-15)(-3.5)+(-5)(-0.5)+(5)(-0.5)+(15)(4.5) =52.5+2.5-2.5+67.5=120. $$

The sum of squared \(x\)-deviations is \(225+25+25+225=500\), so \(b_1=120/500=0.24\) points per minute. The intercept is

$$ b_0=7.5-(0.24)(25)=1.5. $$

The fitted line is \(\hat{y}=1.5+0.24x\). At the mean \(x\)-value,

$$ \hat{y}=1.5+(0.24)(25)=1.5+6=7.5=\bar{y}. $$

As a further check, the fitted values at \(x=10,20,30,40\) are \(3.9,6.3,8.7,11.1\). The residuals, observed minus fitted, are \(0.1,0.7,-1.7,0.9\) points. Their sum is

$$ 0.1+0.7-1.7+0.9=0. $$

The zero residual sum is consistent with the least-squares intercept equation. Individual residuals are not all zero, so this check does not imply that the fitted line passes through every observed pair.

What the Property Does and Does Not Say

The mean point gives a reference location for the fitted line: when the explanatory variable equals its sample mean, the fitted response equals the sample mean response. In that sense, the intercept adjusts the vertical position of the line to balance the fitted values around the response mean. This is a mathematical feature of the least-squares equations, not evidence by itself that the relationship is strong or that the line is a good practical summary.

The zero-sum residual result provides another route to the same idea. Since the residuals sum to zero, the sum of observed responses equals the sum of fitted responses. The fitted values lie on a line, and their average is the line’s value at \(\bar{x}\):

$$ \frac{1}{n}\sum_{i=1}^{n}\hat{y}_i =\frac{1}{n}\sum_{i=1}^{n}(b_0+b_1x_i) =b_0+b_1\bar{x} =\bar{y}. $$

This equality concerns averages. Positive and negative residuals can still be large, and the data may show a curved pattern or substantial scatter. The mean-point property alone cannot establish that the linear form is appropriate or that predictions are accurate.

The property can also help identify arithmetic errors. After calculating a least-squares line, substitute \(\bar{x}\) into the equation and check that the result equals \(\bar{y}\), up to rounding. If it does not, inspect the intercept calculation, the sample means, and any prematurely rounded coefficients. With rounded slope and intercept, a small discrepancy can arise because the reported coefficients are only approximations.

Common Mistake

A common mistake is to say, “The regression line passes through the average observation, so one of the data points must lie at \((\bar{x},\bar{y})\).” That reasoning confuses the coordinate-wise averages with an observed pair. The mean \(x\)-value may come from averaging all the \(x\)-values, and the mean \(y\)-value from averaging all the \(y\)-values; those two averages need not belong to the same individual.

The correction is to state exactly what the identity guarantees: the fitted value at \(x=\bar{x}\) is \(\bar{y}\). It does not guarantee a zero residual for any particular observation, nor does it make every fitted value equal to its observed response.

Key takeaway: The least-squares intercept satisfies \(b_0=\bar{y}-b_1\bar{x}\). Therefore, substituting \(x=\bar{x}\) into \(\hat{y}=b_0+b_1x\) gives \(\hat{y}=\bar{y}\), so the fitted line passes through \((\bar{x},\bar{y})\).

Check Your Understanding

Use the definitions and equations in this tutorial to answer the questions.

  1. A fitted line is \(\hat{y}=8+2x\), with \(\bar{x}=4\). What must \(\bar{y}\) be if this is a least-squares line? Show the substitution.
  2. Explain why the mean point can lie on the fitted line without being one of the observed data points.
  3. For a least-squares line, the residuals sum to zero. Write the equation that results from substituting \(e_i=y_i-(b_0+b_1x_i)\) into that condition.
  4. A student says that passing through the mean point proves a regression line is a good fit. What does the property actually establish, and what does it not establish?
  5. Why can rounding a reported slope and intercept cause the fitted value at \(\bar{x}\) to differ slightly from \(\bar{y}\)?