Hypothesis Tests for Regression Slope

When we fit a least-squares regression line to data, we obtain a sample slope b₁ that estimates the true population slope β₁. But how confident can we be that a real linear relationship exists in the population — and not just in our particular sample? Hypothesis testing for regression slope answers exactly this question by asking: could the observed slope have occurred by chance if the true relationship were actually flat (β₁ = 0)? The null hypothesis H₀: β₁ = 0 asserts that the explanatory variable has no linear effect on the response variable in the population. The alternative hypothesis is usually Hₐ: β₁ ≠ 0 (two-sided), though one-sided versions are also used. To test this, we use a t-test based on the sampling distribution of the sample slope b₁. Under the null hypothesis and certain conditions, this test statistic follows a t-distribution with n − 2 degrees of freedom. Regression inference is powerful because it moves beyond mere description ('the slope in my sample is 2.4') to inference ('there is strong statistical evidence that the true slope is not zero'). It is widely used in science, economics, medicine, and social research whenever investigators want to establish whether two quantitative variables are genuinely linearly associated in a larger population.

Key takeaways
  • Verify Conditions (LINE)
  • State the Hypotheses
  • Calculate the Test Statistic
  • Find the P-value
  • Make a Conclusion

Verify Conditions (LINE)

Before performing the test, confirm four conditions. L – Linearity: the scatter plot of y vs. x should be roughly linear. I – Independence: observations must be independent of each other (check that n < 10% of the population for random sampling). N – Normality: the residuals should be approximately normally distributed (check a histogram or normal probability plot of residuals). E – Equal variance (homoscedasticity): the spread of residuals should be roughly constant across all values of x (check a residual plot; no fan shape).

State the Hypotheses

State H₀: β₁ = 0 (no linear relationship in the population) and the alternative hypothesis. The two-sided alternative Hₐ: β₁ ≠ 0 is most common. A one-sided alternative Hₐ: β₁ > 0 or Hₐ: β₁ < 0 is used when there is a specific directional claim before seeing the data.

Calculate the Test Statistic

The test statistic is t = b₁ / SE(b₁), where b₁ is the sample slope and SE(b₁) is its standard error. The standard error of the slope is SE(b₁) = s / √(Σ(xᵢ − x̄)²), where s = √[Σ(yᵢ − ŷᵢ)² / (n − 2)] is the residual standard error (also called s_e). This t-statistic measures how many standard errors the sample slope is away from zero.

Find the P-value

Compare the t-statistic to a t-distribution with df = n − 2. For a two-sided test, the P-value = 2 · P(T > |t|) where T ~ t(n−2). Most statistical software (and many graphing calculators) compute this automatically. A smaller P-value means stronger evidence against H₀.

Make a Conclusion

Compare the P-value to the significance level α (commonly 0.05). If P-value ≤ α, reject H₀ and conclude there is statistically significant evidence of a linear relationship between x and y in the population. If P-value > α, fail to reject H₀; there is insufficient evidence of a linear relationship. Always state your conclusion in the context of the problem.

The Key Equation

t=b1SE(b1)=b1s∑(xi−xˉ)2t = \frac{b_1}{SE(b_1)} = \frac{b_1}{\dfrac{s}{\sqrt{\sum(x_i - \bar{x})^2}}}
  • b_1 — Sample slope (units of y / units of x): The estimated slope of the least-squares regression line calculated from the sample data.
  • SE(b_1) — Standard error of the slope (units of y / units of x): Measures how much the sample slope b₁ would vary from sample to sample; smaller values mean more precise estimates.
  • s — Residual standard error (units of y): Estimates the standard deviation of the residuals: s = √[Σ(yᵢ − ŷᵢ)² / (n − 2)], using n − 2 degrees of freedom.
  • \sum(x_i - \bar{x})^2 — Sum of squared deviations of x (units of x squared): Measures the total spread of the x-values. Larger spread in x produces a more precise (smaller SE) estimate of slope.
  • n - 2 — Degrees of freedom (dimensionless): The t-distribution used for p-values has n − 2 degrees of freedom; two degrees of freedom are lost because both the slope and intercept are estimated.

Worked Example

Problem. A researcher studies whether study hours (x) predicts exam score (y) for 12 students. The least-squares line is ŷ = 42.3 + 5.8x. The residual standard error is s = 7.2, and Σ(xᵢ − x̄)² = 64.0. Test H₀: β₁ = 0 vs. Hₐ: β₁ ≠ 0 at α = 0.05.

t=5.80.90≈6.44,df=10,P-value<0.001t = \frac{5.8}{0.90} \approx 6.44, \quad df = 10, \quad P\text{-value} < 0.001

Answer. Reject H₀. There is statistically significant evidence (t = 6.44, df = 10, P < 0.001) that study hours linearly predicts exam score.

Figure
Diagram
Hypothesis Test for Regression Slope: Visual SummaryScatter Plot (Sample Data)ŷ = b₀+b₁xx (explanatory)y (response)t-Distribution (df = n−2)0t*−t*P/2P/2Reject H₀ in red tailsDecision FrameworkH₀: β₁ = 0No linear relationshipHₐ: β₁ ≠ 0Linear relationship existst = b₁/SE(b₁)P ≤ α → Rejectdf = n − 2SE(b₁) = s / √Σ(xᵢ−x̄)²s = √[Σresid²/(n−2)]Larger |t| → stronger evidence against H₀
Origins · 1 minFrancis Galton and how this was discovered
FG
Francis Galton
1822–1911 · British

Francis Galton pioneered the concept of regression in the 1880s when studying the relationship between parents' heights and their children's heights. He observed that children of tall parents tended to be shorter than their parents — a phenomenon he called 'regression toward mediocrity' (now called regression to the mean). His work laid the conceptual groundwork for what became the formal theory of linear regression and eventually regression inference. Galton was so prolific that he invented the weather map, the concept of the correlation coefficient, and even developed one of the first fingerprint classification systems — all in addition to his statistical innovations.

  • Confidence Intervals for Regression Slope — Confidence intervals for β₁ and hypothesis tests are two sides of the same coin — both use SE(b₁) and the t-distribution to make inferences about the true population slope.
  • t-Tests for Means — The regression slope test uses the same t-distribution machinery as the one-sample and two-sample t-tests — understanding t-tests for means builds intuition for the slope test.
  • Least-Squares Regression Line — The sample slope b₁ used in the hypothesis test comes directly from the least-squares regression line; understanding how b₁ is calculated is essential prerequisite knowledge.
  • Residuals and Residual Plots — Checking residual plots is a required step for verifying the conditions (linearity, equal variance, normality) needed before performing regression inference.