Sub topic 4
Testing individual coefficients with t-tests
This chapter assumes you know how a t-test and a p-value work, and that you have read the earlier chapters on the multiple regression model and its assumptions. Here you will learn how to test whether one slope coefficient differs from a hypothesized value, how to read the numbers in regression output, and which mistakes show up most often on the exam and in practice.
What the test answers
A multiple regression estimates a coefficient for each independent variable. Those estimates come from a sample, so they carry sampling error. The t-test on a single coefficient asks whether the true population slope could plausibly equal some hypothesized value, usually zero.
Take the model:
Y = b0 + b1·X1 + b2·X2 + ε
A test of H0: b1 = 0 asks whether X1 helps explain Y once X2 is already in the model. This is the "holding the other variables constant" interpretation of a partial slope. The same variable can be significant in one model and insignificant in another, because the other regressors change what "holding constant" means.
The test statistic
For a coefficient bj with estimated standard error s(bj), the t-statistic is:
t = (b̂j − bj,H0) / s(b̂_j)
- b̂_j is the estimated coefficient.
- b_j,H0 is the hypothesized value. It is 0 in most output tables.
- s(b̂_j) is the standard error of the estimate.
The statistic follows a t-distribution with n − k − 1 degrees of freedom. Here n is the number of observations and k is the number of independent variables. The extra 1 accounts for the intercept.
You reject H0 when |t| exceeds the critical value for your chosen significance level and degrees of freedom. Equivalently, you reject when the p-value is smaller than the significance level.
| Quantity | Meaning | Typical use |
|---|---|---|
| Coefficient | Estimated change in Y per one-unit change in X, others held constant | Interpretation |
| Standard error | Sampling variability of the coefficient | Denominator of t |
| t-statistic | Coefficient divided by standard error (when testing against 0) | Decision rule |
| p-value | Smallest significance level at which H0 is rejected | Decision rule |
| Confidence interval | Range of plausible values for the true slope | Estimation |
A worked example
Suppose you regress a fund's monthly excess return on the market excess return and a size factor, using 60 months of data. The output reports:
| Variable | Coefficient | Standard error |
|---|---|---|
| Intercept | 0.20 | 0.15 |
| Market | 0.95 | 0.08 |
| Size | 0.30 | 0.18 |
The degrees of freedom are n − k − 1 = 60 − 2 − 1 = 57. At the 5% level with a two-tailed test, the critical value is about 2.00.
- Market: t = 0.95 / 0.08 = 11.88. This is far above 2.00, so you reject H0: b = 0. The market beta is statistically significant.
- Size: t = 0.30 / 0.18 = 1.67. This is below 2.00, so you fail to reject H0. At the 5% level you cannot conclude the size loading differs from zero.
- Intercept: t = 0.20 / 0.15 = 1.33. You fail to reject, so you cannot conclude the fund earned a nonzero alpha.
Now test a different hypothesis. A manager claims the market beta is 1.0. Then H0: b1 = 1 and:
t = (0.95 − 1.00) / 0.08 = −0.625
The absolute value is below 2.00, so you fail to reject. The data are consistent with a beta of 1.
Note that "fail to reject" is not "accept". The test lacked the evidence to rule the value out. A wide standard error makes almost any hypothesis hard to reject.
Running the test in code
The code below fits a two-variable regression on simulated data and prints the t-statistics alongside the other standard output. The true coefficients are 1.0, 2.0 and −1.0, so you should see large t-statistics for all three.
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()
print(model.params)
print(model.tvalues)
print(model.rsquared, model.rsquared_adj)
print(model.fvalue, model.f_pvalue)
print(model.aic, model.bic)The tvalues array lists the t-statistic for the constant, x1 and x2 in that order. The params array holds the coefficients. Dividing each entry of params by the matching standard error (model.bse) reproduces tvalues. Here the degrees of freedom are 200 − 2 − 1 = 197.
One-tailed and two-tailed tests
Most software reports a two-tailed test of H0: b = 0 against Ha: b ≠ 0. You use a one-tailed test when theory predicts a sign. For example, you might expect a variable's coefficient to be positive, so Ha: b > 0.
- Two-tailed at 5%: each tail holds 2.5%. The critical value is larger.
- One-tailed at 5%: one tail holds 5%. The critical value is smaller.
If you need a one-tailed p-value from a two-tailed one, halve it, but only when the estimated sign matches the sign in Ha. If the sign is opposite, the one-tailed test cannot reject.
Confidence intervals
A confidence interval for a slope is:
b̂j ± tcritical × s(b̂_j)
For the size coefficient above, the 95% interval is 0.30 ± 2.00 × 0.18, or about −0.06 to 0.66. The interval contains zero, which matches the failure to reject H0: b = 0. The interval also contains any other hypothesized value you could not reject, so it summarizes many tests at once.
Significance versus size
A small p-value says the estimate is distinguishable from the hypothesized value. It does not say the effect is large. With a big sample, a tiny coefficient can have a huge t-statistic. Always read the coefficient's size next to its t-statistic and ask whether the effect matters in the units of Y.
The reverse also happens. A coefficient can be economically large but statistically insignificant because the standard error is large. Both cases need judgment, not a mechanical rule.
Common errors
- Using the wrong degrees of freedom. The correct value is n − k − 1. Using n − 1 or n − k gives a slightly wrong critical value. The difference is small in large samples and can matter in small ones.
- Testing against zero when the hypothesis is different. If the null is b = 1, you must subtract 1 in the numerator. Reading the printed t-statistic gives the wrong answer.
- Treating "fail to reject" as proof of zero effect. The test has limited power when the standard error is large.
- Ignoring multiple tests. If you test many coefficients at 5%, some will look significant by chance. With 20 independent tests of true nulls, you expect about one false rejection.
- Trusting the standard errors blindly. The t-test is only valid if the standard errors are valid. Violations of the assumptions can break this.
When the standard errors are wrong
The t-statistic divides by the standard error, so any distortion in the standard error distorts the test. The three problems covered in later chapters affect this in different ways.
| Problem | Effect on coefficient estimates | Effect on standard errors | Effect on t-tests |
|---|---|---|---|
| Heteroskedasticity | Still unbiased and consistent | Usually biased, direction depends on the pattern | Unreliable, may reject too often or too rarely |
| Positive serial correlation | Still unbiased and consistent | Usually too small | t-statistics too large, too many false rejections |
| Multicollinearity | Still unbiased | Inflated | t-statistics too small, true effects look insignificant |
The following code shows one remedy. It simulates errors whose variance grows with x, runs diagnostic checks, and refits with heteroskedasticity-robust standard errors. Compare the original and robust standard errors, because the t-tests use those.
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.diagnostic import het_breuschpagan
from statsmodels.stats.stattools import durbin_watson
rng = np.random.default_rng(0)
n = 200
x = rng.normal(size=n)
y = 1.0 + 2.0 * x + rng.normal(size=n) * (1 + np.abs(x))
X = sm.add_constant(x)
model = sm.OLS(y, X).fit()
lm_stat, lm_pvalue, f_stat, f_pvalue = het_breuschpagan(model.resid, model.model.exog)
print("Breusch-Pagan p-value:", lm_pvalue)
print("Durbin-Watson:", durbin_watson(model.resid))
robust = sm.OLS(y, X).fit(cov_type="HC1")
print(robust.bse)After the robust fit, the t-statistics in robust.tvalues use the corrected standard errors. The coefficients stay the same. Only the denominator of each t-statistic changes. The next chapters cover how to detect each problem and which correction suits it.
How the t-test fits with the F-test
The t-test on one coefficient and the F-test on all coefficients can disagree. It is possible for the F-test to reject the hypothesis that all slopes are zero while every individual t-test fails to reject. This pattern is a classic symptom of multicollinearity: the regressors share so much information that the model fits well overall, but no single coefficient can be pinned down. The reverse, a significant t-test with an insignificant F-test, is rare and usually points to a calculation error or a test run across many variables by chance.
Decision process
The diagram summarizes the steps for testing one coefficient.
Summary of key points
- The t-statistic is the estimate minus the hypothesized value, divided by the standard error.
- Degrees of freedom are n − k − 1.
- A confidence interval and a two-tailed test at the matching level always agree.
- Statistical significance is not the same as economic importance.
- The test is only as good as the standard errors, which heteroskedasticity, serial correlation and multicollinearity can distort.
Exercise
A regression with 40 observations and 3 independent variables gives a coefficient of 0.80 with a standard error of 0.30 for one variable. At the 5% level, the two-tailed critical t-value for the relevant degrees of freedom is about 2.03. (a) How many degrees of freedom does the test have? (b) Test H0: b = 0. (c) Test H0: b = 1.
Show answer
(a) n − k − 1 = 40 − 3 − 1 = 36. (b) t = 0.80 / 0.30 = 2.67. Because 2.67 exceeds 2.03, reject H0: the coefficient is significantly different from zero. (c) t = (0.80 − 1.00) / 0.30 = −0.67. The absolute value is below 2.03, so fail to reject: the data are consistent with a coefficient of 1.
Exercise
In a model with strong positive serial correlation and no correction, a coefficient has a t-statistic of 2.4. Should you trust that it is significant at the 5% level? Why or why not?
Show answer
Not without checking. Positive serial correlation usually makes the standard errors too small, which makes the t-statistic too large. The apparent significance may be a false rejection. Re-estimate with serial-correlation-consistent (for example Newey-West) standard errors and test again.