Solution (source code)

= Solution

Use the usual <normal linear model> $Y=X\beta+\varepsilon$, with fixed full-column-rank design $X\in\mathbb R^{n\times p}$, $n>p$, and $\varepsilon\sim N(0,\sigma^2I_n)$. These <Gaussian distribution> and constant-<variance> hypotheses are necessary for an exact finite-sample <Student's t-test>. Put $V=(X^TX)^{-1}$ and $\nu=n-p$. The vector of <ordinary least squares estimators> satisfies
$$
\widehat\beta=(X^TX)^{-1}X^TY,\qquad\boxed{\widehat\beta_0\sim N(\beta_0,\sigma^2V_{00}).}
$$
With $s^2=\|Y-X\widehat\beta\|^2/\nu$, the <test statistic> is
$$
\boxed{T=\frac{\widehat\beta_0}{s\sqrt{V_{00}}}.}
$$
Under the <null hypothesis>, $T$ has <Student's t-distribution> with $\nu$ <degrees of freedom>. A two-sided level-$5\%$ <Student's t-test> rejects when $|T|>t_{\nu,0.975}$. If the intended test is one-sided against $\beta_0>0$, it rejects when $T>t_{\nu,0.95}$; the <statistical power> conclusion below holds for either convention.