I understand, that the basic model of simple linear regression assumes homoscedasticity, i.e. the variances $\sigma^2$ around the regression line are equal for all predictor levels/values.
With this assumption in mind, I wonder why confidence intervals for a predicted $y$ value are not equally large for all predictor levels. The formula for such a confidence interval (e.g. 95%) suggests, that the interval gets larger, when the difference between the predictor value of interest $x$ and the mean predictor value $\overline x$ increases (see the enumerator under the root):
$\hat y \pm t_{n-2}(0.975) \cdot s \cdot \sqrt{1 + \frac{1}{n} + \frac{(x- \overline x)^2}{\sum_{i=1}^n \left(x_i - \overline x \right)^2}}$
The increasing size of CIs toward the edges of a distribution can also be seen in standard geom_smooth()
plots by the ggplot2
package in R.
Now, how can the variances around the regression line be equal at all predictor levels, but the corresponding CIs are larger at the edges?
Is this a problem of sample and population, insofar as the difference in CI range shrinks, when the sample gets larger (When $n \rightarrow \infty$, you can drop the entire root term in the CI formula), while at the same time there is higher evidence for homoscedasticity when $n$ gets larger?
Or do I get things completely wrong and the two things are totally independent of each other?