By the end of this lesson, you should be able to
- Calculate an estimated standard error for a simple regression slope.
- Describe the slope t test in a model with independent errors.
- Distinguish in-sample fit from warranted inference and prediction.
A regression program prints a slope of 0.6. Is that a strong association? It depends on what one unit of the predictor means, how spread out the observations are, and how uncertain the estimate is.
We should not stop at the fitted line.
Where the slope comes from
For paired observations, let
Once the intercept is fitted, the residual sum of squares is
Under the usual independent constant-variance normal-error model, estimate the error variance as . The standard error of the slope is then
The denominator reflects estimating both the intercept and slope.
A fully worked example
Consider five fictional paired observations:
| x | y |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 5 |
| 4 | 4 |
| 5 | 5 |
Here , , , and . The fitted line is
The residuals are , so . Thus , and the slope standard error is .
For the null , the t statistic is , with three residual degrees of freedom under the stated model.
The sample is tiny; apparent positive slopes can still carry considerable uncertainty.
What else must be checked?
The usual test relies on a statistical model for observations and errors. Curvature, unequal residual variance, dependence, influential observations, or incorrect functional form can undermine a naive t reference distribution.
For multiple regression, slope coefficients also depend on which other predictors are included. Correlated predictors can increase uncertainty and complicate interpretation.
And none of this alone proves changing x causes y to change.
Reproduce with base R
fit <- lm(c(2,4,5,4,5) ~ c(1,2,3,4,5))
summary(fit)
confint(fit)
Report the coefficient in its original units, its uncertainty, design assumptions, and limitations.
Check your understanding
- Why is the residual degrees of freedom in a simple intercept-plus-slope model?
- Does a high guarantee a significant causal slope?
- Why would extrapolation far beyond observed x values be risky?
Worked responses
-
Two coefficients (intercept and slope) were estimated from the observations.
-
No. Association, uncertainty, and causality are distinct claims.
-
The fitted linear relationship may not hold outside the observed range.
An interval, a mean response, and a new observation
For the five-point example, and . A 95% slope interval is therefore
The data show a positive fitted slope but also substantial uncertainty under the classical model. This interval refers to change in the conditional population mean response per unit of predictor, not a prediction interval for a new response.
At a specified predictor , the estimated conditional mean is . Its standard error is . For a new independent observation at that predictor, the prediction standard error is . The extra one represents the new observation’s residual variability. Under the normal-error model, matching t critical values produce mean-response and prediction intervals, respectively.
At in the example, , mean-response standard error , and new-observation standard error . The resulting intervals are about and . Prediction is harder than estimating a conditional mean. Both intervals widen away from the observed predictor center, even before we confront the additional risk that the model ceases to hold outside its observed range.
These formulas treat predictor values as fixed or condition on them, assume correctly specified linear conditional means and independent constant-variance errors, and use normal errors for exact small-sample t calibration. Robust standard errors address some variance misspecification but do not repair nonlinear mean structure, selection, or confounding.
Additional practice
- Holding error variance and predictor spread per observation similar, why does increasing sample size tend to reduce slope uncertainty?
- Why is a prediction interval wider than a conditional-mean interval at the same input?
- If all predictor values are identical, which formula fails and what does that mean?
Worked additional solutions
- generally grows with the number of independent observations, reducing .
- A new observation has its own residual variability in addition to coefficient-estimation uncertainty.
- , so the slope is not identified. A flat predictor column supplies no observed variation with which to estimate a response trend.
Keep your place
Mark this lesson complete after you've read it, attempted its exercises, and explained its central idea in your own words.
Progress is not saved unless you choose to mark the lesson complete.
Saved only in this browser's local storage. No required account, server transmission, or analytics. You can reset your saved progress on the course page. Clearing browser data also clears the record.