Inference for
Regression Coefficients
Master the t-tests and F-tests for regression coefficients expressed in matrix form: from the OLS estimator to hypothesis testing.
The Linear Model in Matrix Form
We begin with the classical linear regression model. Instead of writing individual equations for each observation, we stack everything into a single matrix equation that is compact, elegant, and powerful for derivations.
The OLS Estimator \(\hat{\boldsymbol{\beta}}\)
Minimizing the sum of squared residuals \(\|\mathbf{y} - \mathbf{X}\boldsymbol{\beta}\|^2\) with respect to \(\boldsymbol{\beta}\) yields the Ordinary Least Squares estimator in closed form:
Estimating \(\sigma^2\)
Since \(\sigma^2\) is unknown in practice, we estimate it from the residuals. The residual vector is \(\hat{\boldsymbol{\varepsilon}} = \mathbf{y} - \mathbf{X}\hat{\boldsymbol{\beta}}\), and the unbiased estimator is:
The t-Test for Individual Coefficients
To test whether a single coefficient is significantly different from a hypothesized value \(\beta_{j,0}\), we construct a t-statistic. The most common test is \(H_0\!: \beta_j = 0\).
Visualizing the t-Distribution
The F-Test for Multiple Coefficients
When we want to test several coefficients simultaneously, such as \(H_0\!: \mathbf{C}\boldsymbol{\beta} = \mathbf{d}\) where \(\mathbf{C}\) is a \(q \times p\) matrix of contrasts, we use the general linear hypothesis F-test.
Special Case: The Overall F-Test
The most common F-test asks: are any of the predictors useful? This tests \(H_0\!: \beta_1 = \beta_2 = \cdots = \beta_{p-1} = 0\) (all slopes zero, intercept excluded).
t-Test vs F-Test: Key Distinction
| t-Test | F-Test | |
|---|---|---|
| Hypotheses | Single coefficient: \(H_0\!: \beta_j = 0\) | Multiple coefficients: \(H_0\!: \mathbf{C}\boldsymbol{\beta} = \mathbf{d}\) |
| Statistic | \(t_j = \hat{\beta}_j / \text{SE}(\hat{\beta}_j)\) | Quadratic form in \(\mathbf{C}\hat{\boldsymbol{\beta}} - \mathbf{d}\) |
| Distribution | \(t_{n-p}\) | \(F_{q,\, n-p}\) |
| Relationship | When \(q = 1\): \(t_j^2 = F_{1,\, n-p}\) | |
| Direction | Can be one-sided or two-sided | Always one-sided (right tail) |
Confidence Intervals for \(\beta_j\)
The duality between tests and confidence intervals gives us an interval estimate directly from the t-statistic. A \((1-\alpha)\) confidence interval for \(\beta_j\) is:
How to Apply Inference for Coefficients
Example 1: t-Test Setup
A simple regression with \(n = 25\) observations and \(p = 3\) parameters (intercept + 2 predictors). We are given:
Test \(H_0\!: \beta_1 = 0\) vs \(H_1\!: \beta_1 \neq 0\) at \(\alpha = 0.05\).
Example 1: t-Test Conclusion
Example 2: Joint F-Test
Using the same data, test \(H_0\!: \beta_1 = \beta_2 = 0\) (both predictors are useless). Here \(\mathbf{C} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1\end{pmatrix}\) and \(\mathbf{d} = \mathbf{0}\).
Example 3: Partial F-Test via SSE
An equivalent formulation uses the difference in SSE between the full model and the reduced model. Let \(\text{SSE}_F\) be the full model's error and \(\text{SSE}_R\) the reduced model's error.
Common Mistakes
Question 1 of 5
Under the classical normal linear model, the distribution of the t-statistic for testing \(H_0\!: \beta_j = 0\) is:
Question 2 of 5
In the formula \(\text{SE}(\hat{\beta}_j) = s\sqrt{c_{jj}}\), what is \(c_{jj}\)?
Question 3 of 5
A model with \(n = 50\) and \(p = 4\) yields \(\hat{\beta}_2 = 3.2\) with \(\text{SE}(\hat{\beta}_2) = 1.0\). What is the t-statistic for \(H_0\!: \beta_2 = 0\)?
Question 4 of 5
When testing \(H_0\!: \beta_1 = \beta_2 = 0\) using the general F-test, the numerator degrees of freedom is:
Question 5 of 5
If a 95% confidence interval for \(\beta_3\) is \((-0.5,\; 2.1)\), which conclusion is correct?