Centred simple linear regression (source code)

= Centred simple linear regression
{title2=$\widehat\alpha=\overline Y,\quad\widehat\beta=S_{xy}/S_{xx}$}

In <simple linear regression> written as $Y_i=\alpha+\beta(x_i-\bar x)+\varepsilon_i$, the constant and centred predictor columns are orthogonal. Differentiating the sum of squared residuals gives the displayed <ordinary least squares estimators>, provided $S_{xx}=\sum_i(x_i-\bar x)^2>0$. For independent mean-zero errors of common variance $\sigma^2$, both estimators are unbiased, their variances are $\sigma^2/n$ and $\sigma^2/S_{xx}$, and their covariance is zero. The uncentred intercept is $\widehat\alpha-\widehat\beta\bar x$.