01 / 21

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.

Statistics Graduate Level

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.

\(\mathbf{y}\)
Response vector: all \(n\) observed outcomes
\(\mathbf{X}\)
Design matrix: rows are observations, columns are predictors (including intercept)
\(\boldsymbol{\beta}\)
Coefficient vector: the unknown parameters we wish to test

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:

1
Unbiased: \(E[\hat{\boldsymbol{\beta}}] = \boldsymbol{\beta}\) under the model assumptions.
2
Variance: \(\text{Var}(\hat{\boldsymbol{\beta}}) = \sigma^2 (\mathbf{X}^\top \mathbf{X})^{-1}\).
3
Distribution: \(\hat{\boldsymbol{\beta}} \sim N\!\bigl(\boldsymbol{\beta},\; \sigma^2 (\mathbf{X}^\top \mathbf{X})^{-1}\bigr)\).

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:

\(\mathbf{H}\)
Hat matrix: \(\mathbf{H} = \mathbf{X}(\mathbf{X}^\top\mathbf{X})^{-1}\mathbf{X}^\top\). Projects \(\mathbf{y}\) onto the column space of \(\mathbf{X}\).
\(n - p\)
Degrees of freedom: \(n\) observations minus \(p\) estimated parameters.

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\).

1
Numerator: the estimated coefficient minus the hypothesized value.
2
Denominator: the standard error \(\text{SE}(\hat{\beta}_j) = s\sqrt{c_{jj}}\).
3
Distribution: follows a \(t\)-distribution with \(n - p\) degrees of freedom.

Visualizing the t-Distribution

0
\(t^*\)
\(-t^*\)
\(t\)
Reject Reject Fail to Reject
Two-tailed t-test: reject if \(|t| > t^*\)

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.

\(q\)
Number of restrictions being tested (numerator df)
\(n - p\)
Residual degrees of freedom (denominator df)

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).

1
SSR (regression sum of squares): \(\hat{\boldsymbol{\beta}}^\top \mathbf{X}^\top \mathbf{y} - n\bar{y}^2\). Measures explained variation.
2
SSE (error sum of squares): \(\mathbf{y}^\top\mathbf{y} - \hat{\boldsymbol{\beta}}^\top \mathbf{X}^\top \mathbf{y}\). Measures unexplained variation.
3
Reject \(H_0\) when \(F > F^*_{\alpha,\, p-1,\, n-p}\). A large \(F\) means the model explains significant variation.

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:

\(\hat{\beta}_j\)
Center of the interval: the point estimate from OLS
\(t^*_{\alpha/2,\, n-p}\)
Critical value from the \(t\)-distribution at the desired level
\(s\sqrt{c_{jj}}\)
Standard error: \(s\) estimates \(\sigma\), \(c_{jj}\) comes from \((\mathbf{X}^\top\mathbf{X})^{-1}\)

How to Apply Inference for Coefficients

1
Fit the model: Compute \(\hat{\boldsymbol{\beta}} = (\mathbf{X}^\top\mathbf{X})^{-1}\mathbf{X}^\top\mathbf{y}\).
2
Estimate \(\sigma^2\): Compute \(s^2 = \text{SSE}/(n-p)\). The residual degrees of freedom matter.
3
Get the covariance matrix: \(\widehat{\text{Var}}(\hat{\boldsymbol{\beta}}) = s^2 (\mathbf{X}^\top\mathbf{X})^{-1}\). Diagonals give \(\text{SE}^2\).
4
For a single \(\beta_j\): Compute \(t_j = \hat{\beta}_j / \text{SE}(\hat{\beta}_j)\). Compare to \(t_{n-p}\).
5
For joint tests: Set up \(\mathbf{C}\boldsymbol{\beta} = \mathbf{d}\), compute the F-statistic, compare to \(F_{q, n-p}\).
6
Report: State the conclusion, confidence interval, and p-value in context.

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

1
Degrees of freedom: \(n - p = 25 - 3 = \) 22.
2
Critical value: \(t^*_{0.025, 22} \approx 2.074\).
3
Decision: Since \(1.583\) \(<\) \(2.074\), we fail to reject \(H_0\).

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.

1
Full model (\(p = 5\), \(n = 30\)): \(\text{SSE}_F = 120\). Reduced model (\(p = 3\)): \(\text{SSE}_R = 180\).
2
Numerator: \((180 - 120)/2 = 30\). Denominator: \(120/25 = 4.8\).
3
F-statistic: \(30/4.8 = \) 6.25. Compare to \(F^*_{0.05, 2, 25} \approx 3.39\). Since \(6.25\) \(>\) \(3.39\), reject \(H_0\).

Common Mistakes

✕ Wrong df
Using \(n - 1\) instead of \(n - p\) for the t-test or denominator df. Every estimated parameter costs a degree of freedom.
✕ Forgetting \(s\)
Using \(\sigma\) (unknown) instead of \(s\) in the standard error. This changes the distribution from \(z\) to \(t\).
✕ t-to-F Confusion
Testing multiple coefficients one-at-a-time with t-tests and concluding "all are insignificant." Joint F-test may reject even when individual t-tests do not.

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?