# Why don't we use OLS estimator to test hypothesis in linear regression?

In a linear regression model $$Y = X_1 \beta_1 + X_2 \beta_2 + \epsilon$$, we use ANOVA to test null hypothesis $$H_0 : \beta_2 = 0$$. Denote $$RSS_1$$ as the sum of square of residuals under the submodel $$Y = X_1 \beta_1 + \epsilon$$, denote $$RSS$$ as the sum of square of residuals under the full model $$Y = X_1 \beta_1 + X_2 \beta_2 + \epsilon$$, we choose $$\frac{(RSS_1- RSS)/\text{df}}{RSS/\text{df}}$$ as the test statistic and calculate p-value.

Here is my question: since the OLS estimator $$\hat{\beta}$$ has a $$N(\beta,\sigma^2(X^TX)^{-1})$$ distribution, why don't we simply test the null hypothesis $$H_0 : \beta_2 = 0$$ through $$\hat{\beta}$$? For example, we can take $$\| \hat{\beta_2} \|^2 / \{ \hat{\sigma^2} \sum_i [(X_TX)^{-1}]_{i,i}\}$$ as a test statistic, which takes a t-distribution under null hypothesis.

In fact, this is the method of getting a confidence interval of $$\beta$$. Why don't we test the hypothesis through the same method of getting confidence interval?

The test you are proposing is exactly what is done in the T-test for an individual coefficient, which is presented in the coefficient estimates table. One of the major theorems of regression analysis is that the F-test reduces to equivalence to the T-test when you apply it to a single coefficient. Thus, for an individual coefficient $$\beta_2$$, you should find that the p-value for the two tests you mention are always the same (since they are effectively the same test).