Student t test for regression through the origin (source code)

= Student t test for regression through the origin
{c}
{title2=$T=\widehat\beta\sqrt{\sum x_i^2}/\sqrt{\mathrm{SSE}/(n-1)}$}

For independent $Y_i\sim N(\beta x_i,\sigma^2)$ with $n\geq2$ and $\sum x_i^2>0$, the <least-squares estimator> is $\widehat\beta=\sum x_iY_i/\sum x_i^2$. The projection of the isotropic <Gaussian vector> onto the design direction is independent of its orthogonal residual; hence $\widehat\beta\sqrt{\sum x_i^2}/\sigma$ is standard normal under $\beta=0$ and $\mathrm{SSE}/\sigma^2$ is independent chi-squared with $n-1$ degrees of freedom. The displayed statistic therefore has <Student's t-distribution> with $n-1$ degrees of freedom. A two-sided test rejects at the corresponding upper/lower quantiles. The zero design has no information about the slope; with one observation there is no residual variance degree of freedom.