Simple-regression output identities (source code)

= Simple-regression output identities
{title2=$F=t^2=(n-2)R^2/(1-R^2)$}

= Regression output identities
{synonym}

Consider <ordinary least squares> with an <intercept>, one nonconstant predictor, $n>2$ cases, $S_{xx}=\sum_i(x_i-\bar x)^2>0$ a nonconstant response, and a positive <residual sum of squares>. With the usual common-variance <standard error>, put $s^2=\operatorname{RSS}/(n-2)$. Then
$$
\bar y=\widehat\alpha+\widehat\beta\bar x,\qquad \operatorname{SE}(\widehat\beta)=s/\sqrt{S_{xx}},\qquad F=t_{\mathrm{slope}}^2=\frac{(n-2)R^2}{1-R^2}.
$$
The <least-squares normal equations> give zero residual sum and zero residual <inner product> with the centred predictor, proving the first identity and $\widehat\beta=S_{xy}/S_{xx}$. The fitted centred <sum of squares> is $\widehat\beta^2S_{xx}$. Dividing it by $s^2$ gives the one-predictor F statistic and the squared zero-slope t statistic. Dividing fitted and <residual sums of squares> by their total gives the last expression. If $0\le R^2<1$, the <adjusted coefficient of determination> is $1-(1-R^2)(n-1)/(n-2)$.

These are algebraic consistency identities for one specified fit; the mean identity needs no normal-error assumption. A <normal linear model> supplies the usual finite-sample t and F reference distributions. Heteroscedasticity-robust <standard errors> need not satisfy the displayed F=t-squared relationship to the classical sums-of-squares F statistic. Rounding can create small discrepancies, while different analysed records or a changed model can create larger ones; neither should be silently treated as the same fit.<Summarizing Linear Model Fits in the R documentation>[Value: coefficient matrix, sigma, df, fstatistic and r.squared]{ref}