Sub topic 4
Testing Individual Coefficients with t-Tests
Prerequisites and the question being tested
This chapter assumes that you know simple linear regression, p-values, confidence intervals, and the meaning of a slope. You should also be comfortable reading basic regression output.
A multiple regression model estimates the conditional mean of a dependent variable:
Y = β0 + β1X1 + β2X2 + ... + βkXk + ε
A t-test asks whether one coefficient differs from a specified value while the other variables remain in the model. The usual null hypothesis is:
H0: βj = 0
The alternative hypothesis can be two-sided, H1: βj ≠ 0, or one-sided, such as H1: βj > 0.
The t-statistic
For an estimated coefficient, the t-statistic is:
t = (b_j - βj,0) / SE(b_j)
Here:
b_jis the estimated coefficient.βj,0is the value under the null hypothesis, usually zero.SE(b_j)is the standard error of the estimate.
If the null value is zero, the formula becomes:
t = b_j / SE(b_j)
A large absolute t-statistic provides evidence against the null hypothesis. Under the classical regression assumptions, the statistic follows a t-distribution with n - k - 1 degrees of freedom, where n is the sample size and k is the number of independent variables.
The p-value is the probability of observing a t-statistic at least as extreme as the one calculated, assuming the null hypothesis is true. A small p-value indicates that the coefficient is statistically distinguishable from the null value.
Interpreting a partial slope
In multiple regression, b_j is a partial slope coefficient. It estimates the expected change in Y from a one-unit increase in Xj, holding the other included independent variables constant.
For example, suppose the coefficient on years of experience is 0.80. Holding education and job type constant, one additional year of experience is associated with an estimated increase of 0.80 units in the dependent variable.
The t-test evaluates evidence for the coefficient, not the practical importance of the coefficient. A very small effect can be statistically significant in a large sample. A useful effect can fail to be significant in a small or noisy sample.
| Regression result | Interpretation |
|---|---|
| Large absolute t-statistic and small p-value | Evidence that the coefficient differs from the null value |
| Small absolute t-statistic and large p-value | Insufficient evidence to reject the null |
| Significant coefficient with a small magnitude | Statistical importance may exceed practical importance |
Confidence intervals and decision rules
A 95% confidence interval for a coefficient is:
b_j ± t_critical × SE(b_j)
For a two-sided test at the 5% significance level, reject the null hypothesis if zero is outside the confidence interval. This gives the same conclusion as a two-sided p-value below 0.05.
Do not interpret failure to reject as proof that the coefficient equals zero. It means the sample does not provide enough evidence to distinguish the coefficient from zero at the chosen significance level.
import numpy as np
import statsmodels.api as sm
rng = np.random.default_rng(42)
n = 200
x1 = rng.normal(size=n)
x2 = rng.normal(size=n)
y = 1.0 + 2.0 * x1 - 1.0 * x2 + rng.normal(size=n)
X = sm.add_constant(np.column_stack([x1, x2]))
model = sm.OLS(y, X).fit()
for name, coefficient, t_value, p_value in zip(
["intercept", "x1", "x2"],
model.params,
model.tvalues,
model.pvalues,
):
print(name, coefficient, t_value, p_value)
print(model.conf_int())When the usual t-test is unreliable
The classical t-test depends on assumptions about the error term. Heteroskedasticity can make the usual standard errors wrong, causing misleading t-statistics and p-values. Serial correlation can cause a similar problem in time-series or ordered data. Multicollinearity can make standard errors large, even when the overall regression explains substantial variation.
A common correction for heteroskedasticity is to use heteroskedasticity-robust standard errors. The coefficient estimate stays the same, but its standard error, t-statistic, and p-value can change.
Exercise
A regression estimates b1 = 1.5 with SE(b1) = 0.5. For H0: β1 = 0, what is the t-statistic, and what does a two-sided p-value below 0.05 imply?
Show answer
The t-statistic is 1.5 / 0.5 = 3. A two-sided p-value below 0.05 provides evidence that β1 differs from zero, holding the other included variables constant.