Selecting Procedures for Slopes
When we collect data and fit a least-squares regression line, we naturally ask: is the relationship we see in the sample real, or could it have arisen by chance? Regression inference gives us the tools to answer this question. Specifically, inference about the slope β of a population regression line tells us whether a linear relationship genuinely exists between two quantitative variables and how strong that relationship is likely to be in the broader population. Selecting the right procedure depends on what question you are asking. There are two main inferential tasks for slopes: conducting a hypothesis test to decide whether a linear relationship exists at all (i.e., testing H₀: β = 0), and constructing a confidence interval to estimate the true slope with a stated level of confidence. Both procedures rely on the same set of conditions and the same test statistic, but they answer subtly different questions and are reported differently. Understanding when to use each procedure—and verifying that the necessary conditions are met—is the heart of regression inference. This article walks through the decision process, the mathematics behind both procedures, and the assumptions you must check before trusting your results.
- Identify the question being asked
- Check the conditions (LINE)
- State hypotheses (for a test) or confidence level (for an interval)
- Compute the test statistic or interval
- Interpret in context
Identify the question being asked
If the question asks whether a linear relationship exists or whether the slope is significantly different from zero (or some other value), you need a hypothesis test for the slope. If the question asks you to estimate the slope or provide a range of plausible values, you need a confidence interval for the slope. Both use the t-distribution with n − 2 degrees of freedom.
Check the conditions (LINE)
Before computing anything, verify four conditions using the acronym LINE. (L) Linearity: the scatterplot of y vs. x should show a roughly linear pattern; check a residual plot for random scatter with no curve. (I) Independence: observations must be independent of each other; for random samples this is met, and for time-series data watch for patterns in residuals over time. (N) Normality: 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; look for a 'fan' shape in the residual plot as a violation.
State hypotheses (for a test) or confidence level (for an interval)
For a hypothesis test, the standard hypotheses are H₀: β = 0 (no linear relationship) versus Hₐ: β ≠ 0 (two-sided), β > 0, or β < 0 (one-sided), depending on context. Choose the alternative before looking at data. For a confidence interval, decide on a confidence level C (commonly 90%, 95%, or 99%) based on how much precision is required.
Compute the test statistic or interval
The t-test statistic for the slope is t = b / SE_b, where b is the sample slope and SE_b is the standard error of b. This statistic follows a t-distribution with df = n − 2 under H₀. For a confidence interval, the formula is b ± t · SE_b, where t is the critical value from the t-distribution with df = n − 2 at the desired confidence level. The standard error of the slope is SE_b = s / √(Σ(xᵢ − x̄)²), where s = √(SSE / (n − 2)) is the residual standard error.
Interpret in context
A hypothesis test produces a P-value: if P < α, reject H₀ and conclude there is statistically significant evidence of a linear relationship. A confidence interval produces a range: if the interval does not contain 0, this is consistent with a significant slope at the corresponding α level. Always interpret in the context of the variables, not just with numbers. For example: 'We are 95% confident that for each additional hour of study, the true mean score increases by between 2.1 and 5.3 points.'
The Key Equation
- b — Sample slope (units of y per unit of x): The least-squares estimate of the true population slope β, calculated from sample data.
- \beta_0 — Hypothesized slope (units of y per unit of x): The value of the slope stated in the null hypothesis; almost always 0 when testing for any linear relationship.
- SE_b — Standard error of the slope (units of y per unit of x): Measures how much the sample slope b would vary across repeated samples; smaller SE means more precise estimates.
- s — Residual standard error (units of y): Estimates the standard deviation of the error terms; computed from the sum of squared residuals with n − 2 degrees of freedom.
- n — Sample size (count): The number of data points used to fit the regression line; degrees of freedom for the t-distribution are n − 2.
Worked Example
Problem. A researcher randomly selects 12 high school students and records x = hours spent exercising per week and y = resting heart rate (beats per minute). Software output shows: sample slope b = −2.4 bpm/hr, SE_b = 0.85 bpm/hr, and n = 12. All LINE conditions are satisfied. (a) Test at α = 0.05 whether a negative linear relationship exists. (b) Construct a 95% confidence interval for the slope.
Answer. Reject H₀ (P ≈ 0.009); 95% CI for slope is (−4.29, −0.51) bpm/hr.
Origins · 1 minFrancis Galton and how this was discovered
Francis Galton invented the concept of regression and correlation in the 1880s while studying the relationship between parents' heights and their children's heights. He coined the term 'regression to the mean' and developed the first formal regression line, laying the foundation for all modern regression analysis including the inference methods used today. Galton was a polymath who also invented the weather map, the concept of fingerprint identification for forensic science, and pioneered the use of surveys. He was a half-cousin of Charles Darwin and was deeply influenced by Darwin's theory of evolution.
Related Concepts
- Conditions for Regression Inference — Before selecting any procedure for slopes, you must verify the LINE conditions; this concept explains each condition in depth and how to check them using residual plots.
- Confidence Intervals for the Slope — One of the two main procedures covered here; understanding the mechanics of constructing and interpreting slope intervals deepens your ability to select between procedures.
- Hypothesis Testing for the Slope — The other main procedure; studying how to set up and carry out a significance test for β = 0 is essential for complete mastery of regression inference.
- t-Distribution Procedures — Regression inference for slopes uses the t-distribution with n − 2 degrees of freedom; understanding the general t-distribution framework helps connect regression inference to other inference methods.
- Least-Squares Regression Line — The sample slope b and its standard error SE_b come directly from the LSRL calculation; a solid understanding of how b is computed is prerequisite to understanding inference about it.