Why Predictor Location Matters
A fitted regression line gives a predicted response at any chosen predictor value, but the uncertainty in that estimate is not equally large everywhere along the line. The estimate of a mean response is typically most precise near the sample mean of the predictor values. As the chosen predictor value moves farther from that center, its confidence interval becomes wider.
The same predictor-location effect appears in a prediction interval for an individual response. That interval also includes the additional variability of individual responses around the regression line, so it is wider overall; but its width still grows with distance from the sample predictor mean. The key is to separate two sources of uncertainty: uncertainty about the mean response at a chosen predictor value, and the extra variation of an individual response around that mean.
The Standard Error and Its Location Term
For a confidence interval for the mean response at \(x_0\), the fitted mean is \(\hat{y}(x_0)=b_0+b_1x_0\). Under the simple linear regression model, its estimated standard error is
Here \(s\) is the residual standard deviation estimate. A two-sided confidence interval with confidence level \(1-\alpha\) is
where \(t^*_{n-2}\) is the positive critical value from a \(t\) distribution with \(n-2\) degrees of freedom that leaves probability \(\alpha/2\) in each tail. The interval’s half-width is the critical value multiplied by the standard error; its full width is twice that half-width. With the data set, confidence level, and residual variation held fixed, the predictor-location term is the part that changes with \(x_0\).
For an individual response, the corresponding prediction interval uses
The extra \(1\) accounts for the response’s own variation around the mean response. It does not remove the location effect: the same squared-distance term makes the prediction interval wider farther from \(\bar{x}\).
Why the Formula Has This Shape
The location term can be understood from the usual simple linear regression model. Assume the conditional mean is linear, the errors are independent with mean zero and common variance \(\sigma^2\), and the errors are normally distributed for the exact \(t\)-interval procedure. In inference, the residual standard deviation \(s\) estimates \(\sigma\). The predictor values are treated as fixed, or the calculations are understood conditional on their observed values.
The fitted value at \(x_0\) can be written as \(\hat{y}(x_0)=\bar{y}+b_1(x_0-\bar{x})\). The sample mean response and the least-squares slope are uncorrelated because the slope is calculated using predictor deviations whose sum is zero. Their variances under the model are \(\sigma^2/n\) and \(\sigma^2/S_{xx}\), respectively. Therefore, the variance of the fitted mean is the sum of the variance of \(\bar{y}\) and the variance contributed by the slope term:
Replacing \(\sigma\) by \(s\) gives the standard error formula. At \(x_0=\bar{x}\), the slope contribution vanishes: the fitted mean there is \(\bar{y}\), so its estimated standard error is \(s/\sqrt{n}\). Away from the center, uncertainty in the estimated slope contributes increasingly to uncertainty in the fitted mean. This explains the added squared-distance term rather than merely stating a pattern in interval widths.
Worked Example: The Interval at the Sample Predictor Mean
Suppose a hypothetical regression summary has \(n=8\), \(\bar{x}=10\) hours of study, \(S_{xx}=40\) squared hours, and residual standard deviation \(s=4\) quiz points. The fitted line is \(\hat{y}=50+2x\). Assume the linear model and its independence, constant-variance, and normal-error conditions are reasonable for these hypothetical data. Find a 95% confidence interval for the mean quiz score at \(x_0=10\) hours.
There are \(n-2=6\) degrees of freedom, and the 95% critical value is approximately \(t^*_6=2.447\). Since \(x_0=\bar{x}\), the location term is zero:
The fitted mean is \(50+2(10)=70\) quiz points. Thus the margin of error, using the unrounded standard error, is approximately \(2.447(1.4142136)=3.4606\) points. The interval is
This interval is centered at the fitted mean. Its location-related standard error is at its minimum for these data because the predictor value is exactly \(\bar{x}\). The interval describes uncertainty about the mean quiz score for the population represented by the model at 10 hours, not the likely range of scores for every individual student.
Moving Away from the Center
The next example uses the same hypothetical regression summary and confidence level. Since \(n\), \(s\), \(S_{xx}\), and the critical value have not changed, differences in standard errors and widths come from the predictor location alone.
Worked Example: Comparing an Off-Center Mean Response
Using the regression summary above, find a 95% confidence interval for the mean quiz score at \(x_0=14\) hours. The hypothetical model assumptions are the same as in the preceding example.
The predictor is 4 hours above the sample mean, so the location term is \(4^2/40=0.4\). The standard error is
The fitted mean is \(50+2(14)=78\) points. The margin of error is approximately \(2.447(2.8983)=7.0921\) points, giving
The mean-response interval at 14 hours is wider than the interval at 10 hours: its standard error is about 2.898 points rather than 1.414 points. This is not because the fitted mean at 14 hours is inherently less accurate in every realized sample. Rather, under the model, its sampling variability is larger because estimating the slope has more influence on fitted values farther from \(\bar{x}\).
Leverage and Response-Interval Precision
In simple linear regression, the quantity
is called the leverage at predictor value \(x_0\). For an observed data point \(x_i\), this is its diagonal leverage value. The same expression can be evaluated at a new prediction value, even if that value was not observed. In the mean-response formula, \(SE\bigl(\hat{y}(x_0)\bigr)=s\sqrt{h(x_0)}\); in the individual prediction formula, the standard error is \(s\sqrt{1+h(x_0)}\). Thus, higher leverage corresponds directly to greater interval standard error, all else equal.
Leverage reflects the predictor value’s position relative to the overall pattern of predictor values. It is not a measure of how unusual the response is, and high leverage does not by itself mean that an observation is an outlier or that it has a large residual. A point can be far out in predictor space yet lie close to the fitted line. Conversely, a large residual concerns the response’s distance from the line, not just the predictor’s location.
Worked Example: A More Distant Prediction Value
Continue with the hypothetical regression summary, but now consider \(x_0=18\) hours. This value is farther from the sample predictor mean than 14 hours. Suppose the goal is both to find the mean-response interval and to compare it with a prediction interval for one student. Use the same model assumptions and 95% critical value.
The leverage is
The mean-response standard error is \(4\sqrt{1.725}\approx5.2536\) quiz points. The fitted mean is \(50+2(18)=86\) points. The margin of error is approximately \(2.447(5.2536)=12.8555\) points, so the mean-response interval is
For an individual response, the standard error includes the additional \(1\):
The prediction-interval margin of error is approximately \(2.447(6.6030)=16.1576\) points. The prediction interval is therefore
Both intervals are wider than their corresponding intervals at the sample mean because leverage has increased. The prediction interval is wider still because it accounts for the variability of an individual student’s score around the mean. The numerical comparison illustrates the formula; a real analysis would also need to check whether using the fitted line at 18 hours is supported by the observed predictor values and the model conditions.
Why the Pattern Matters
The term \((x_0-\bar{x})^2/S_{xx}\) shows that predictor location and predictor spread work together. For a fixed distance from \(\bar{x}\), a larger \(S_{xx}\) makes the location contribution smaller. When observed predictor values are spread out, the slope is generally estimated more precisely, so moving a given distance from the center adds less uncertainty. When the observed values are tightly clustered, even a modest distance can add substantially to the standard error.
The effect is especially important when a requested value lies beyond the observed predictor range. The formula may still produce an interval, but the regression model’s linear pattern at that distant value may not be supported by data. A wide interval signals greater modeled uncertainty; it does not, by itself, establish that the fitted value is biased or wrong. In addition to interpreting the interval width, consider whether the model is credible at the requested predictor value.
Common Mistake
A common mistake is to conclude that the regression line is “least reliable” at every predictor value far from \(\bar{x}\), as if interval width directly measured whether the model is correct. The standard error formula makes a narrower claim: under the assumed model, sampling uncertainty in the fitted response is larger at locations with higher leverage. It does not test whether the linear form is appropriate there, whether the data contain an influential observation, or whether the response variance is constant. Those questions require examining the data and checking the model conditions. Another mistake is to compare only the fitted values at two locations: different fitted means do not indicate different precision; compare their standard errors or interval widths.
Check Your Understanding
Use the definitions and formulas in this tutorial to answer the following questions.
- In the mean-response standard error formula, what happens to the location term when \(x_0=\bar{x}\), and what is the resulting standard error?
- If two predictor values are equally far from \(\bar{x}\), with the same regression summary, how do their mean-response standard errors compare? Explain using the squared-distance term.
- What does leverage describe in simple linear regression, and how is it related to the standard error of a fitted mean?
- Why is a prediction interval wider than a mean-response interval at the same \(x_0\), and do both intervals change with predictor location?
- Why does a wide response interval at a distant predictor value not, by itself, prove that the regression model is wrong there?