AP Statistics • Inference for Quantitative Data: Slopes

Setting Up a Test for the Slope of a Regression Model

Learn to formulate hypotheses and verify conditions for inference about the true linear relationship between two quantitative variables.

A scatter plot with data columns and a percentage symbol.
Inside this lesson 10 sections 5 questions 10 figures

SECTION 1

Historical Context & Motivation

When we fit a least-squares regression line to a sample of bivariate data, the resulting slope b₁ is a point estimate of the true population slope β₁. But how confident can we be that the observed relationship did not arise purely from random sampling variability? This question—whether the apparent linear trend is statistically meaningful—motivated some of the most important developments in 20th-century statistics. The machinery of hypothesis testing for regression slopes grew from work on correlation, least-squares estimation, and the theory of sampling distributions.

1805 • Legendre's Least Squares

Adrien-Marie Legendre published the first formal account of the method of least squares for fitting a line to data, laying the algebraic foundation for regression analysis.

1885 • Galton Coins 'Regression'

Sir Francis Galton introduced the term 'regression' while studying the heights of parents and children, observing that extreme values tended to 'regress' toward the mean in the next generation.

1908 • Student's t-Distribution

William Sealy Gosset, writing under the pseudonym 'Student,' derived the t-distribution for small-sample inference—the very distribution we rely on when testing regression slopes.

1922 • Fisher's Framework

R. A. Fisher formalized the concepts of maximum likelihood estimation and significance testing, unifying the theory behind testing parameters such as the slope of a regression model.

The central question this lesson addresses is deceptively simple: given sample data with a nonzero slope b₁, can we conclude that the true population slope β₁ is different from zero (or some other hypothesized value)? Answering this requires specifying the correct hypotheses, defining the population model, checking the conditions that legitimize inference, and identifying the appropriate test statistic—all of which we will develop step by step.

SECTION 2

Core Principles & Definitions

Before performing any significance test, you must understand the theoretical model that underpins inference about the slope. The simple linear regression model posits that for each value of the explanatory variable x, the response variable y is drawn from a distribution whose mean falls on the true regression line. Formally, we write y = β₀ + β₁x + ε, where ε represents the random deviation of each observation from that line. Setting up a test for β₁ requires familiarity with several foundational ideas that work together to make inference valid.

1

The Population Regression Model

The true model is y = β₀ + β₁x + ε. The parameters β₀ (intercept) and β₁ (slope) are fixed but unknown constants that describe the population relationship.
2

Null & Alternative Hypotheses

H₀: β₁ = 0 (no linear relationship) versus Hₐ: β₁ ≠ 0 (or β₁ > 0 or β₁ < 0). The null claims that x has no linear effect on y.
3

Conditions for Inference

Linearity, Independence, Normal responses, and Equal variance (the LINE conditions) must be met for the t-test on the slope to be valid.
4

The t-Test Statistic

t = (b₁ − β₁₀) / SE(b₁), where β₁₀ is the hypothesized value of the slope (usually 0). This statistic follows a t-distribution with df = n − 2.
5

Standard Error of the Slope

SE(b₁) quantifies the variability of the sample slope across repeated samples. It depends on the residual standard deviation s and the spread of the x-values.
✦

KEY TAKEAWAY

Think of the sample slope b₁ like a single measurement from a thermometer that has some built-in measurement error. The hypothesis test asks: is the reading far enough from zero that we can rule out the possibility that the true temperature (β₁) is actually zero? The standard error is like the precision rating of the thermometer—smaller SE means greater confidence that our reading reflects reality.

SECTION 3

Visual Explanation: The Regression Model

The diagram below illustrates the conceptual framework behind inference for the slope. At each value of x, the response y is assumed to come from a normal distribution centered on the true regression line. The spread of each distribution is σ (assumed equal at every x), and the slope β₁ determines how the center shifts as x increases. When we test H₀: β₁ = 0, we are asking whether the centers are truly shifting—or whether the apparent tilt in our sample regression line could be attributed to chance.

Population Regression Model: y = β₀ + β₁x + εExplanatory Variable (x)Response (y)True line: y = β₀ + β₁xμ₁μ₂μ₃x₁x₂x₃Sample data pointsTrue regression lineNormal distribution of y
At each value of x, the response y follows a normal distribution (violet ellipse) centered on the true regression line (dashed cyan). The pink dots represent observed sample data. Testing β₁ = 0 asks whether these conditional means truly shift as x changes.

Notice that all three normal distributions have the same spread (σ). This reflects the equal variance (homoscedasticity) condition. If the true slope β₁ were zero, these distributions would all be centered at the same height—meaning the response would be unrelated to x. The hypothesis test formalizes exactly this comparison.

SECTION 4

Mathematical Framework

Setting up the test requires specifying the hypotheses, the test statistic, and its sampling distribution. We begin with the population regression model and derive the t-statistic used to assess whether the sample slope provides sufficient evidence against the null.

POPULATION MODEL

y=β0+β1x+ε,whereε N(0,σ)y = β₀ + β₁x + ε, where ε ~ N(0, σ)

β₀ = population y-intercept; β₁ = population slope (the parameter of interest); ε = random error term, assumed to follow a normal distribution with mean 0 and standard deviation σ, which is constant for all x.

HYPOTHESES

H0:β1=0vs.Ha:β1≠0(orHa:β1>0orHa:β1<0)H₀: β₁ = 0 vs. Hₐ: β₁ ≠ 0 (or Hₐ: β₁ > 0 or Hₐ: β₁ < 0)

The null hypothesis states there is no linear relationship between x and y. The alternative may be two-sided or one-sided, depending on the research question. On the AP exam, the context of the problem determines the direction.

TEST STATISTIC

t=(b1−0)/SE(b1)withdf=n−2t = (b₁ − 0) / SE(b₁) with df = n − 2

b₁ = sample slope from least-squares regression; SE(b₁) = standard error of the slope, typically given in computer output; n = number of data points; degrees of freedom = n − 2 because two parameters (β₀ and β₁) are estimated.

STANDARD ERROR OF THE SLOPE

SE(b1)=s/√(Σ(xi−xˉ)2)SE(b₁) = s / √(Σ(xᵢ − x̄)²)

s = √(Σeᵢ² / (n − 2)) is the residual standard error (also called the standard deviation of the residuals). A smaller s and a wider spread of x-values both reduce SE(b₁), yielding a more powerful test.

In practice, the AP Statistics exam provides computer output that lists b₁, SE(b₁), the t-statistic, and the p-value. Your primary responsibility is to state the hypotheses correctly, verify the conditions, identify the correct test (a t-test for the slope of a regression model), and interpret the output in context. Understanding the formula for SE(b₁) deepens your intuition: more data, less scatter around the line, and more spread in x all give you a sharper test.

SECTION 5

The LINE Conditions in Detail

Before a t-test for the slope is valid, four conditions—often remembered by the acronym LINE—must be verified. Failing to check these conditions on a free-response question is one of the most common point-losing mistakes on the AP exam. The following diagram and table detail each condition, including how to assess it from residual plots and contextual information.

Checking the LINE Conditions via Residual Plots✓ Conditions Met✗ Conditions ViolatedLinear & Equal Variance0Random scatter, constant spread ✓Non-Linear (Curved Pattern)0U-shaped residuals → linearity violated ✗Normal ResidualsRoughly symmetric, bell-shaped ✓Unequal Variance (Fan Shape)0Spread increases with x → equal variance violated ✗All plots show residuals (vertical axis) vs. x or ŷ (horizontal axis)
Top-left: residuals with random scatter and constant spread (conditions met). Top-right: a curved pattern in the residuals reveals a nonlinear relationship. Bottom-left: a roughly symmetric histogram of residuals supports normality. Bottom-right: a fan-shaped residual plot indicates unequal variance (heteroscedasticity).
ConditionWhat It MeansHow to Check
L — LinearityThe true relationship between x and y is linear.Look at the scatterplot of x vs. y and the residual plot vs. x. There should be no obvious curved pattern.
I — IndependenceIndividual observations are independent of each other.Consider the data collection: random sampling or random assignment supports independence. For samples without replacement, verify n < 10% of the population.
N — NormalFor any given x, the responses y (equivalently, the residuals) are approximately normally distributed.Examine a histogram, dotplot, or normal probability plot of the residuals. With large n, mild departures are acceptable due to the CLT.
E — Equal VarianceThe standard deviation of y is the same for all values of x.Check the residual plot for a 'fan' or 'trumpet' shape. The vertical spread of residuals should remain roughly constant across x.

The LINE conditions for inference on the slope of a regression model.

💡

AP Exam Tip

On free-response questions, you must explicitly name or describe each condition and provide evidence from the context or given plots that it is (or is not) satisfied. Simply listing 'LINE' without explanation earns minimal credit. Describe what you see in the residual plot and connect it to the specific condition.

SECTION 6

Worked Example: Setting Up the Slope Test

A researcher investigates whether the number of hours students spend studying per week is a significant linear predictor of their exam score (out of 100). A random sample of 25 students is collected. The least-squares regression yields the following computer output:

PredictorCoefSE Coeftp-value
Constant52.3874.21512.43< 0.001
Hours2.8140.6834.120.0004

Regression output: S = 6.13, R-Sq = 42.5%

Additionally, the residual plot shows random scatter with no obvious pattern, and a histogram of the residuals is roughly symmetric and bell-shaped.

Setting Up and Identifying the Test for the Slope

  1. 1

    Step 1 — State the Hypotheses

    Let β₁ represent the true slope of the population regression line relating weekly study hours (x) to exam score (y). We test:
    H₀: β₁ = 0 (study hours have no linear effect on exam score) vs. Hₐ: β₁ ≠ 0 (study hours do have a linear effect on exam score). A two-sided alternative is appropriate because the research question asks whether hours predict score, without specifying a direction a priori.
  2. 2

    Step 2 — Identify the Test and Parameters

    We will perform a t-test for the slope of a regression model. The relevant parameter is β₁, the population slope. The sample slope is b₁ = 2.814, with SE(b₁) = 0.683. Degrees of freedom: df = n − 2 = 25 − 2 = 23.
    This is a t-test for the slope with df = 23.
  3. 3

    Step 3 — Check Conditions (LINE)

    Linearity: The residual plot shows no curved pattern, so a linear model is appropriate. Independence: The 25 students were selected randomly, and it is reasonable to assume that 25 is less than 10% of all students in the population. Normal: The histogram of residuals is roughly symmetric and bell-shaped, with no strong skewness or outliers, supporting approximate normality. Equal Variance: The residual plot shows roughly constant vertical spread across x, with no fan shape.
    All four LINE conditions are satisfied; we may proceed with the t-test.
  4. 4

    Step 4 — Compute (or Read) the Test Statistic

    From the output: t = b₁ / SE(b₁) = 2.814 / 0.683 = 4.12. We can verify this matches the value reported in the table. The p-value for this two-sided test is 0.0004.
    t = 4.12, p-value = 0.0004.
  5. 5

    Step 5 — State the Conclusion in Context

    Because the p-value (0.0004) is less than any conventional significance level (e.g., α = 0.05), we reject H₀. There is convincing statistical evidence that the true slope of the population regression line relating weekly study hours to exam score is not zero—meaning study hours are a significant linear predictor of exam score.
    Reject H₀. There is convincing evidence at the α = 0.05 level that weekly study hours have a linear effect on exam score.

SECTION 7

Common Errors & Pitfalls

Students frequently lose points on AP free-response questions not because they cannot do the calculation (the computer output provides the numbers), but because they misstate hypotheses, inadequately check conditions, or misinterpret results. The table below contrasts common errors with best practices.

Common ErrorCorrect Practice
Writing hypotheses in terms of b₁ (sample slope) instead of β₁ (population slope).Always write H₀: β₁ = 0 and Hₐ: β₁ ≠ 0 (or one-sided). The hypothesis is about the population parameter, not the sample statistic.
Using r (correlation) or r² in the hypotheses instead of β₁.The t-test for the slope tests β₁. Although testing ρ = 0 yields the same t-statistic, the AP exam expects β₁ for the regression slope test.
Saying 'the data are normal' or 'x is normal' when checking conditions.State that the residuals are approximately normally distributed. Check via a histogram or normal probability plot of residuals.
Skipping the independence check because 'it's a random sample.'Mention both that the data were collected via random sampling (or assignment) AND, if sampling without replacement, verify that n < 10% of the population.
Concluding that x 'causes' y based solely on the test result.A significant slope from an observational study indicates a linear association, not causation. Only randomized experiments support causal claims.

Common errors and corrections when setting up a slope test.

✦

KEY TAKEAWAY

The mechanics of the t-test are handled by software; your job on the AP exam is to communicate the reasoning behind the test. Think of yourself as a lawyer presenting a case: you must state the claim (hypotheses), present the evidence (conditions and test statistic), and deliver a verdict (conclusion in context). Omitting any part weakens your argument—and costs you rubric points.

SECTION 8

Connections to Confidence Intervals & Multiple Regression

The t-test for the slope is closely related to the confidence interval for β₁, which provides a range of plausible values for the true slope. A 95% confidence interval that does not contain zero leads to the same conclusion as a two-sided test at α = 0.05 that rejects H₀. This duality—hypothesis test and confidence interval yielding consistent conclusions—is a central theme in inference. In more advanced coursework, these ideas extend naturally to multiple linear regression, where each predictor's slope is tested while controlling for other variables.

FeatureSlope t-Test (AP Statistics)Multiple Regression (Beyond AP)
Number of predictors1 (simple linear regression)2 or more
HypothesesH₀: β₁ = 0H₀: βⱼ = 0 for each predictor j, controlling for others
Degrees of freedomn − 2n − k − 1, where k is the number of predictors
Complementary intervalb₁ ± t* × SE(b₁)bⱼ ± t* × SE(bⱼ) for each coefficient
Global testt-test and F-test are equivalent (F = t²)F-test evaluates whether at least one predictor is significant

Comparing simple regression inference with multiple regression.

For the AP Statistics exam, you need only work with simple linear regression (one predictor). However, recognizing that the t-test for the slope is a building block of more general linear modeling deepens your understanding and provides a bridge to college-level courses in regression analysis and econometrics.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A statistics student writes the following hypotheses for a test of the slope of a regression model: H₀: b₁ = 0 Hₐ: b₁ > 0 Which of the following best describes the error in these hypotheses?
  • A. The alternative hypothesis should be two-sided (b₁ ≠ 0) rather than one-sided.
  • B. The hypotheses should be written in terms of the population parameter β₁, not the sample statistic b₁.
  • C. The null hypothesis should set the slope equal to the sample slope rather than zero.
  • D. The hypotheses should reference the correlation coefficient r instead of the slope.
  • E. There is no error; the hypotheses are correctly stated.
Show answer (B)
The correct answer is B. Hypotheses must always be stated in terms of the population parameter, which for the slope of a regression model is β₁. The symbol b₁ denotes the sample slope and is a statistic, not a parameter. Choice A is incorrect because a one-sided alternative can be appropriate when the research question specifies a direction. Choice C is incorrect because the null hypothesis for this test specifies 'no linear relationship' (slope = 0), not the observed sample value. Choice D is incorrect because the regression slope test uses β₁, not the correlation coefficient, even though testing ρ = 0 is mathematically equivalent. Choice E is incorrect because the use of b₁ instead of β₁ is a substantive error that would lose credit on the AP exam.

Question 2: BASIC CALCULATION

A regression analysis of the relationship between daily temperature (°F) and ice cream sales ($) for a random sample of 30 days produced b₁ = 3.45 and SE(b₁) = 1.15. What are the value of the test statistic and the degrees of freedom for testing H₀: β₁ = 0?
  • A. t = 3.00, df = 29
  • B. t = 3.00, df = 28
  • C. t = 3.45, df = 28
  • D. t = 3.00, df = 30
  • E. t = 0.333, df = 28
Show answer (B)
The correct answer is B. The test statistic is t = b₁ / SE(b₁) = 3.45 / 1.15 = 3.00. The degrees of freedom for a t-test on the slope of a simple linear regression are n − 2 = 30 − 2 = 28. Choice A incorrectly uses df = n − 1 = 29, which would apply to a one-sample t-test, not a regression slope test. Choice C uses the slope value itself (3.45) as the test statistic rather than computing the ratio. Choice D uses df = n = 30, which is simply the sample size and not a valid df for any inference procedure here. Choice E inverts the ratio (1.15 / 3.45 ≈ 0.333), dividing SE by b₁ instead of b₁ by SE.

Question 3: INTERMEDIATE

A biologist collects data on the wing length (mm) and body mass (g) of 40 randomly captured birds of a particular species. She fits a least-squares regression of body mass on wing length and obtains the following partial output: b₁ = 0.482, SE(b₁) = 0.126, s = 3.87, R² = 0.278 The residual plot shows no clear pattern, but the histogram of residuals reveals a moderate right skew. Which of the following is the best assessment of the conditions for performing a t-test on the slope?
  • A. The conditions are not met because the normality condition is severely violated by the right skew.
  • B. The conditions are met because R² is large enough to guarantee valid inference.
  • C. The conditions are approximately met because linearity, independence, and equal variance appear satisfied, and with n = 40 the t-test is robust to moderate skewness.
  • D. The conditions cannot be assessed without seeing the original scatterplot of the data.
  • E. The conditions are not met because the sample size of 40 does not exceed the minimum of 50 required for regression inference.
Show answer (C)
The correct answer is C. The residual plot with no clear pattern supports linearity and equal variance. Independence is reasonable given random capture, assuming 40 is less than 10% of the bird population. Although the histogram of residuals shows moderate right skew, with n = 40 the t-procedures for regression are reasonably robust to non-normality. Choice A overstates the concern—moderate skew with n = 40 is typically acceptable; severe skew or strong outliers would be more problematic. Choice B is wrong because R² measures the proportion of variance explained but has no bearing on whether inference conditions are satisfied. Choice D is incorrect because the residual plot provides the key diagnostic information for checking linearity and equal variance. Choice E is wrong because there is no minimum sample-size threshold of 50 for regression inference; with larger samples the normality condition becomes less critical.

Question 4: APPLIED

4 pts
An environmental scientist studies the relationship between the concentration of a pollutant (ppm) in a lake and the distance (km) from an industrial discharge point. Data are collected from 20 randomly selected locations. The regression output is shown below. Predictor | Coef | SE Coef | t | p-value Constant | 14.82 | 1.37 | 10.82 | <0.001 Distance | −0.96 | 0.21 | −4.57 | 0.0002 S = 2.44, R-Sq = 53.7% The scientist wants to determine whether pollutant concentration decreases significantly as distance from the discharge point increases. The residual plot shows random scatter with constant spread, and a normal probability plot of residuals is approximately linear. (a) State the appropriate hypotheses for the scientist's research question. Define the parameter in context. (b) Verify the conditions for performing the test. (c) Identify the test statistic and p-value from the output. Does the p-value from the output need to be adjusted? Explain. (d) State an appropriate conclusion at the α = 0.05 significance level in context.
Show answer
RUBRIC (4 points): Point 1 — Hypotheses (1 point): Let β₁ represent the true slope of the population regression line relating distance from the discharge point (x, in km) to pollutant concentration (y, in ppm). H₀: β₁ = 0 (there is no linear relationship between distance and pollutant concentration). Hₐ: β₁ < 0 (pollutant concentration decreases as distance increases). A one-sided alternative is appropriate because the scientist specifically hypothesizes a decrease. Point 2 — Conditions (1 point): Linearity: The residual plot shows random scatter with no curved pattern, supporting a linear model. Independence: Locations were randomly selected, and 20 locations are likely less than 10% of all possible sampling locations on the lake. Normality: The normal probability plot of residuals is approximately linear, supporting the normality of residuals. Equal Variance: The residual plot shows constant spread (no fan shape). All four LINE conditions are satisfied. Point 3 — Test statistic and p-value (1 point): From the output, t = −4.57 with df = 20 − 2 = 18. The reported p-value of 0.0002 is for a two-sided test (the default in most software). Because we are conducting a one-sided test (Hₐ: β₁ < 0) and the observed slope is negative (consistent with our alternative), the appropriate p-value is 0.0002 / 2 = 0.0001. Point 4 — Conclusion in context (1 point): Because the p-value (0.0001) is less than α = 0.05, we reject H₀. There is convincing evidence that the true slope of the regression line relating distance from the industrial discharge point to pollutant concentration is negative—that is, pollutant concentration significantly decreases as distance from the discharge point increases.

Question 5: CRITICAL THINKING

4 pts
A researcher fits a least-squares regression line predicting annual medical expenditure (in thousands of dollars) from body mass index (BMI) using a random sample of 200 adults from a health survey. The computer output gives b₁ = 0.37, SE(b₁) = 0.058, t = 6.38, and p < 0.001. (a) A colleague argues: 'The p-value is extremely small, so BMI must have a large effect on medical expenditure.' Critique this reasoning. In your response, distinguish between statistical significance and practical significance, and reference the value of b₁. (b) Another colleague notes that the residual plot shows a clear fan shape—residuals become more spread out for higher fitted values. Explain why this matters for the validity of the test and describe a possible remedy. (c) The data come from an observational study. A news article reports the findings by stating, 'Higher BMI causes increased medical costs.' Is this conclusion justified? Explain, referencing the study design. (d) Suppose the researcher wanted a more powerful test. Identify two features of the data or sampling design that, if changed, would increase the power of the t-test for the slope, and explain why each would help.
Show answer
RUBRIC (4 points): Point 1 — Statistical vs. Practical Significance (1 point): The colleague conflates statistical significance with a large effect. A small p-value means it is very unlikely to observe a slope as extreme as 0.37 if β₁ were truly zero—but it does not mean the effect is practically large. The slope b₁ = 0.37 means that each one-unit increase in BMI is associated with only a $370 increase in annual medical expenditure. Whether this is 'large' depends on the context—for a single individual, this may be modest. With n = 200, even a small true effect can produce a highly significant result because SE(b₁) shrinks with larger sample sizes. One should always examine the magnitude of b₁ and possibly a confidence interval, not just the p-value. Point 2 — Fan-Shaped Residuals and Equal Variance (1 point): A fan-shaped residual plot indicates that the equal variance (homoscedasticity) condition is violated. The standard errors reported by ordinary least-squares regression assume constant variance; when this assumption fails, SE(b₁) may be too small (or too large), making the t-statistic unreliable and the p-value inaccurate. A possible remedy is to apply a transformation to the response variable (e.g., a log transformation of medical expenditure), which often stabilizes variance. Alternatively, the researcher could use weighted least squares or report robust (heteroscedasticity-consistent) standard errors. Point 3 — Causation and Study Design (1 point): The causal conclusion is not justified. The data come from an observational study (a health survey), not a randomized experiment. Confounding variables—such as age, income, diet, and exercise habits—could be associated with both BMI and medical expenditure, creating a spurious or inflated association. Without random assignment of BMI levels (which is neither ethical nor feasible), we can only conclude that there is a statistically significant linear association between BMI and medical expenditure, not that higher BMI causes higher costs. Point 4 — Increasing Power (1 point): Two features that would increase the power of the t-test for the slope: (1) Increase the sample size n. A larger sample decreases SE(b₁) because the denominator √Σ(xᵢ − x̄)² generally grows, making the t-statistic larger for a given true β₁ and making it easier to detect a real effect. (2) Sample individuals with a wider range of BMI values. Greater variability in x increases Σ(xᵢ − x̄)², which directly reduces SE(b₁) = s / √Σ(xᵢ − x̄)², increasing the test's ability to detect a nonzero slope. (Other acceptable answers include reducing measurement error to decrease the residual standard deviation s.)

SUMMARY

Summary

Summary

Setting up a test for the slope of a regression model begins with the population regression model y = β₀ + β₁x + ε. We state hypotheses about β₁—typically H₀: β₁ = 0 versus a two-sided or one-sided alternative—then verify the LINE conditions (Linearity, Independence, Normal residuals, Equal variance) using residual plots and contextual information. The test statistic is t = b₁ / SE(b₁) with df = n − 2, and the conclusion must be stated in the context of the problem, distinguishing association from causation.

Remember: on the AP exam, hypotheses use the population parameter β₁ (never b₁), conditions must be explicitly checked with evidence, and for one-sided tests you may need to halve the two-sided p-value from computer output. Mastering these procedural details, paired with a deep understanding of the underlying model, equips you to earn full credit on inference-for-slope questions.

Varsity Tutors • AP Statistics • Setting Up a Test for the Slope of a Regression Model