Lesson 3.8 · 12 min read · about 1 h to master at a very slow pace
Standard Errors, Confidence Intervals and p-values
How uncertain is each coefficient? Standard errors, t-statistics, p-values and confidence intervals, with a full worked example, a real regression output to read, and what a p-value is not.
Coefficients are estimates
Collect a new sample and you'd get different s. Their sampling uncertainty, under uncorrelated errors with equal variance , is
Coefficient uncertainty
are the residual degrees of freedom: observations minus estimated coefficients.
For simple regression this reduces to . The SE is smaller with less noise, more data, more spread in , and less collinearity.
The t-test
Is the true really non-zero? Test against with
The p-value is the probability, assuming is true and the model assumptions hold, of a at least as large as the one observed. If we call the coefficient statistically significant at 5%.
Confidence intervals
With : about 95% of intervals built this way (over repeated samples) contain the true . If the interval excludes 0, the two-sided test rejects at 5%. For large , , so "estimate ± 2 SE" is a good shortcut.
Worked example: dataset B ()
RSS , df , so .
.
. The critical value . Since we fail to reject ().
95% CI: . It includes 0, consistent with the test.
Moral: a positive slope from 5 points is not reliable evidence of a positive true slope.
Size is not significance
Predictor 1: , SE , so . Predictor 2: , SE , so . Predictor 2 has the smaller coefficient but stronger evidence of being non-zero, because it's estimated more precisely. A large coefficient can come with large uncertainty.
What a p-value is not
- Not the probability that is true.
- Not a measure of effect size: with huge , trivial effects become "significant".
- A large p-value isn't proof of no effect: small or collinear predictors can hide a real one.
Reading a real output
Predicting carbon monoxide (mg/m³) from 11 standardised sensor and weather readings in a public air-quality dataset (, 80/20 split). Coefficients are the change in CO per one-SD change in each predictor.
| Predictor | coef | SE | t | p | VIF |
|---|---|---|---|---|---|
| C6H6 (benzene) | 0.586 | 0.040 | 14.8 | 0.000 | 39.9 |
| S2(NMHC) sensor | −0.051 | 0.049 | −1.04 | 0.298 | 61.1 |
| NOx | 0.554 | 0.014 | 39.7 | 0.000 | 5.0 |
| S4(NO2) sensor | 0.446 | 0.022 | 20.0 | 0.000 | 12.7 |
| Temperature | −0.223 | 0.024 | −9.5 | 0.000 | 14.2 |
- Overall fit: in and out of sample, so little overfitting ( is large relative to ).
- Significance: nine of eleven predictors have tiny p-values; S2(NMHC) and S3(NOx) don't.
- Why is S2(NMHC) insignificant? Its VIF is 61 and it correlates 0.98 with benzene. It's nearly a duplicate, so its SE is inflated. That's not evidence the sensor is physically irrelevant: given benzene is in the model, it adds little.
- Association ≠ causation: the negative temperature coefficient doesn't mean cooling the air raises CO; it reflects correlated seasonal and traffic patterns.
Cheatsheet
Standard errors
t-test & CI
p-value sentence
p-value misreadings
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.