Confidence Intervals for Regression Slope
When we fit a least-squares regression line to a sample of data, the slope we calculate is only an estimate of the true population slope. Because every sample is different, the estimated slope will vary from sample to sample. A confidence interval for the regression slope gives us a range of plausible values for the true slope β₁, capturing our uncertainty about that parameter while still giving us actionable information about the direction and strength of a linear relationship. The key idea is that the sample slope b₁ follows an approximately normal distribution (or more precisely, a t-distribution) centered on the true slope β₁, with a standard error that depends on how spread out the residuals are and how spread out the x-values are. Using this sampling distribution, we can construct an interval that—if we repeated our procedure many times with fresh samples—would contain the true slope a specified percentage of the time, such as 95%. Confidence intervals for the slope are essential tools in fields ranging from economics to biology. Rather than simply asking 'is there a relationship?', they answer 'how large is the relationship, and how precisely do we know it?' A narrow interval indicates we have estimated the slope with high precision; a wide interval means more data or less variability would be needed before we can characterize the relationship well.
- Verify Conditions (LINE)
- Calculate the Least-Squares Slope b₁
- Find the Standard Error of the Slope SE(b₁)
- Find the Critical Value t*
- Construct the Interval
Verify Conditions (LINE)
Before computing any interval, check four conditions. L – the relationship between x and y is Linear (check a scatterplot). I – observations are Independent of each other. N – for any fixed x, the residuals are Normally distributed (check a histogram or normal probability plot of residuals). E – the variance of residuals is Equal (constant) across all values of x (check a residual plot for a fan shape). If these conditions hold, inference is valid.
Calculate the Least-Squares Slope b₁
Compute the sample slope using b₁ = r · (sᵧ / sₓ), where r is the sample correlation coefficient, sᵧ is the standard deviation of y, and sₓ is the standard deviation of x. This is the point estimate around which the confidence interval will be centered.
Find the Standard Error of the Slope SE(b₁)
The standard error of the slope is SE(b₁) = s / √(SSₓ), where s is the residual standard deviation (s = √[Σ(yᵢ − ŷᵢ)² / (n − 2)]) and SSₓ = Σ(xᵢ − x̄)² is the total variability in the x-values. A larger spread in x-values or a smaller residual standard deviation both produce a smaller (better) standard error.
Find the Critical Value t*
Because the slope estimate follows a t-distribution with n − 2 degrees of freedom (we lose 2 degrees of freedom for estimating both the slope and intercept), we use a t-table or technology to find the critical value t for our desired confidence level. For a 95% confidence interval with n = 20 observations, we use df = 18 and t ≈ 2.101.
Construct the Interval
The confidence interval is b₁ ± t · SE(b₁). The margin of error is t · SE(b₁). Interpret the result: 'We are C% confident that the true slope β₁ is between [lower bound] and [upper bound].' If the interval does not contain 0, this is consistent with evidence of a linear relationship at the corresponding significance level.
The Key Equation
- b_1 — Sample slope (units of y per unit of x): The estimated slope of the least-squares regression line computed from sample data; the point estimate of the true slope β₁.
- t^* — Critical t-value (dimensionless): The value from the t-distribution with n − 2 degrees of freedom that captures the desired central probability, e.g., 95%.
- s — Residual standard deviation (units of y): Estimates the standard deviation of the residuals; calculated as s = √[Σ(yᵢ − ŷᵢ)² / (n − 2)].
- SS_x — Sum of squares of x (units of x squared): The total variability in the explanatory variable: SSₓ = Σ(xᵢ − x̄)². Larger SSₓ means a more precise slope estimate.
- SE(b_1) — Standard error of the slope (units of y per unit of x): Measures how much the sample slope b₁ typically varies from sample to sample around the true slope β₁.
Worked Example
Problem. A student studies whether hours of study (x) predicts exam score (y) for a random sample of n = 12 students. The regression analysis yields: b₁ = 4.2 points per hour, residual standard deviation s = 6.8 points, and SSₓ = Σ(xᵢ − x̄)² = 52.0 hours². Construct a 95% confidence interval for the true slope β₁.
Answer. The 95% confidence interval for the slope is approximately (2.10, 6.30) points per hour of study.
Origins · 1 minFrancis Galton and how this was discovered
Francis Galton pioneered the concept of statistical regression in the 1880s while studying heredity—specifically the relationship between the heights of parents and their children. He coined the term 'regression to the mean' and developed the mathematical framework of the regression line. His collaboration with Karl Pearson extended this work, laying the groundwork for all modern regression analysis, including the inference procedures we use today to compute confidence intervals for slopes. Galton's original discovery of regression arose from his observation that very tall parents tended to have children who were tall but not quite as tall—heights 'regressed' back toward the population average. He first called this phenomenon 'reversion' before settling on 'regression.'
Related Concepts
- Significance Tests for Regression Slope — Hypothesis tests for β₁ = 0 use the same standard error and t-distribution as confidence intervals, making these two inference procedures closely paired.
- Confidence Intervals for a Population Mean — The structure of a confidence interval (point estimate ± t* · SE) is identical for means and slopes, so understanding one deeply supports understanding the other.
- Least-Squares Regression — The sample slope b₁ produced by least-squares regression is the point estimate at the center of the confidence interval; understanding how b₁ is derived is essential prerequisite knowledge.
- The t-Distribution — The critical value t* used in the confidence interval formula comes from the t-distribution with n − 2 degrees of freedom, so familiarity with the t-distribution is necessary.
- Prediction Intervals in Regression — Prediction intervals estimate a range for an individual future observation, extending the ideas of confidence intervals in regression to a different but related inferential goal.