Solution (source code)

= Solution

Under the <null hypothesis>, the standardized intercept $Z=\sqrt n(\widehat\alpha-\alpha_0)/\sigma$ is standard normal, and $V=\operatorname{RSS}/\sigma^2$ is independent with <chi-squared distribution> of $\nu=n-2$ degrees of freedom. Consequently the <Student t test for a simple-regression intercept> uses
$$
\boxed{T=\frac{\widehat\alpha-\alpha_0}{s/\sqrt n}=\frac Z{\sqrt{V/\nu}}\sim t_{n-2}\quad\text{under }H_0.}
$$
Choose a <significance level> $\gamma\in(0,1)$ before observing the test result. For the two-sided alternative, \b[reject $H_0$ when $|T|>t_{n-2,\,1-\gamma/2}$], where the subscript denotes the indicated <quantile> of the <Student t-distribution>. The null rejection probability is exactly $\gamma$, independent of the nuisance slope and <variance>. Equivalently report the <p-value> $2[1-F_{t_{n-2}}(|T_{\mathrm{obs}}|)]$. The test assumes the normal independent-error model and a positive residual <variance> estimate. In the intercept-only case with $n>1$, use $s^2=\operatorname{RSS}/(n-1)$ and $t_{n-1}$ instead.