= Solution
For $n>2$, the usual <unbiased estimator> of variance is
$$
\boxed{s^2=\frac{\operatorname{RSS}}{n-2},\qquad
\operatorname{RSS}=\sum_i(Y_i-\widehat\alpha-\widehat\beta x_i)^2.}
$$
The fitted mean lies in the two-dimensional span of the constant design vector and $x$. <Orthogonal projection> of the Gaussian error onto its complement gives $n-2$ independent standardized normal coordinates. Hence
$$
\boxed{(n-2)s^2/\sigma^2=\operatorname{RSS}/\sigma^2\sim\chi^2_{n-2}.}
$$
This residual projection is independent of the fitted-coefficient projection. If maximum likelihood for variance is intended instead, its estimator is $\widehat\sigma^2_{\rm ML}=\operatorname{RSS}/n$, with $n\widehat\sigma^2_{\rm ML}/\sigma^2\sim\chi^2_{n-2}$; the denominator differs, not the residual <degrees of freedom>.
Back to article page