AP STATISTICS • INFERENCE FOR QUANTITATIVE DATA: SLOPES

Carrying Out a Test for the Slope of a Regression Model

Determine whether a linear relationship between two quantitative variables is statistically significant using a t-test for the regression slope.

Historical Context & Motivation

The question of whether two quantitative variables share a genuine linear relationship—or whether an apparent trend is merely the product of sampling variability—has occupied statisticians for well over a century. Early work in regression analysis focused on fitting lines to data, but it was the development of formal hypothesis testing that transformed regression from a descriptive tool into an inferential one. The ability to calculate a slope from sample data is useful, but it becomes powerful only when we can determine whether that slope is statistically distinguishable from zero—indicating a real linear association in the population.

1805
Legendre & Least Squares
Adrien-Marie Legendre published the method of least squares, providing a systematic way to fit a line to bivariate data by minimizing the sum of squared residuals.
1908
Student's t-Distribution
William Sealy Gosset, writing under the pseudonym 'Student,' derived the t-distribution for small samples, laying the groundwork for the t-test used in regression inference.
1922
Fisher's Framework
Ronald Fisher formalized the theory of statistical estimation and significance testing, connecting the least-squares regression slope to a sampling distribution and enabling formal hypothesis tests.
1970s–Present
Computer-Aided Regression
Modern statistical software and graphing calculators made it routine to compute regression output—slope estimates, standard errors, t-statistics, and p-values—democratizing inference for the regression slope.

In AP Statistics, you will encounter scenarios in which you collect paired quantitative data—such as hours of study and exam scores, or amount of fertilizer applied and crop yield—and must determine whether the sample slope provides convincing evidence that the true population slope is nonzero. The central question this lesson addresses is: How do we carry out a significance test for β₁, the true slope of the population regression line?

Core Principles & Definitions

Before executing the mechanics of the test, it is essential to understand the conceptual building blocks. A test for the slope of a regression model determines whether the linear relationship observed in sample data provides statistically significant evidence of a linear relationship in the broader population. The test relies on a clearly stated model, precise hypotheses, a test statistic drawn from the sampling distribution of the slope estimator, and a comparison to a reference distribution to obtain a p-value.

1

Population Regression Model

The true relationship is modeled as yᵢ = β₀ + β₁xᵢ + εᵢ, where β₁ is the population slope and εᵢ represents independent, normally distributed errors with mean 0 and constant standard deviation σ.
2

Hypotheses

H₀: β₁ = 0 (no linear relationship) versus Hₐ: β₁ ≠ 0, β₁ > 0, or β₁ < 0 depending on context. The null always asserts that the true slope is zero.
3

t-Statistic for the Slope

The test statistic is t = b₁ / SE(b₁), which measures how many standard errors the sample slope b₁ is from the hypothesized value of 0. It follows a t-distribution with n − 2 degrees of freedom.
4

Conditions for Inference

The test requires: (1) Linearity — the true relationship is linear; (2) Independence — observations are independent; (3) Normal responses — for any given x, y is normally distributed; (4) Equal variance — the spread of residuals is roughly constant across x.
5

Decision via p-Value

The p-value is the probability of obtaining a t-statistic as extreme as (or more extreme than) the observed value, assuming H₀ is true. If p-value < α, we reject H₀ and conclude the evidence supports a linear relationship.
KEY TAKEAWAY
Think of the regression slope test like a quality-control check on a measuring instrument. The sample slope b₁ is your instrument's reading, and the standard error SE(b₁) quantifies the precision of that reading. Just as an engineer asks whether a reading is far enough from zero to trust that a real signal exists—rather than attributing it to instrument noise—you ask whether b₁ is far enough from 0, relative to its SE, to conclude that a true linear relationship exists in the population.

Visual Explanation: The Regression Slope Test

The following diagram illustrates the conceptual flow of carrying out a significance test for the slope of a regression model. On the left, paired data is collected and a least-squares regression line is fit, producing the sample slope b₁ and its standard error SE(b₁). These values feed into the t-statistic computation, which is then compared to the t-distribution with n − 2 degrees of freedom to produce a p-value.

The flow diagram shows the five-step process for carrying out a t-test for the regression slope β₁. Data is collected, the LSRL is fit and conditions are checked (LINE), the t-statistic is computed, the p-value is obtained from the t-distribution with n − 2 degrees of freedom, and a conclusion is stated in context.

Notice that the process begins with data and ends with a contextual conclusion—this mirrors the four-step inference procedure emphasized on the AP exam. The conditions panel on the left reminds you that the LINE conditions (Linearity, Independence, Normality, Equal variance) must be verified before the test statistic and p-value carry any meaning. A residual plot is the primary diagnostic tool for verifying the Linearity, Normality, and Equal variance conditions, while Independence is typically established through knowledge of the study design.

Mathematical Framework

The mathematical framework for testing the slope of a regression model rests on the simple linear regression model, a formal statement about the population from which the sample data are drawn. Each response value yᵢ is assumed to be the sum of a deterministic linear component β₀ + β₁xᵢ and a random error εᵢ. The least-squares regression procedure applied to the sample produces the point estimate b₁ for the population parameter β₁, along with a standard error that quantifies sampling variability in that estimate.

POPULATION REGRESSION MODEL
yᵢ = β₀ + β₁xᵢ + εᵢ where εᵢ ~ N(0, σ)
β₀ = population y-intercept; β₁ = population slope (parameter of interest); xᵢ = value of the explanatory variable for observation i; εᵢ = random error for observation i, assumed independent and normally distributed with mean 0 and constant standard deviation σ.
HYPOTHESES
H₀: β₁ = 0 Hₐ: β₁ ≠ 0 (or β₁ > 0 or β₁ < 0)
The null hypothesis states that the true slope is zero (no linear relationship). The alternative is chosen based on the research question: two-sided (≠ 0) when testing for any linear relationship, or one-sided when the direction is specified.
TEST STATISTIC
t = (b₁ − 0) / SE(b₁) = b₁ / SE(b₁)
b₁ = sample slope (from least-squares regression); SE(b₁) = standard error of the slope, reported in calculator or computer output. Under H₀, this statistic follows a t-distribution with df = n − 2.
STANDARD ERROR OF THE SLOPE
SE(b₁) = s / √(Σ(xᵢ − x̄)²) where s = √(Σeᵢ² / (n − 2))
s = the estimated standard deviation of the residuals (also called the standard error of the regression); Σ(xᵢ − x̄)² measures the spread of x-values. You will not need to compute SE(b₁) by hand on the AP exam—it is provided in the regression output table.

The degrees of freedom for this test are n − 2, where n is the number of data points. Two degrees of freedom are lost because we estimate both β₀ and β₁ from the data. The p-value is then computed from the t-distribution: for a two-sided test, it equals 2 × P(T ≥ |t|); for a one-sided test, it equals P(T ≥ t) or P(T ≤ t) depending on the direction of Hₐ. On the AP exam, you will typically obtain the p-value from calculator output (e.g., LinRegTTest) or from a provided computer printout.

📊 READING COMPUTER OUTPUT
A standard regression output table includes columns for Predictor, Coef, SE Coef, T, and P. The row labeled with the explanatory variable name gives you b₁ (under Coef), SE(b₁) (under SE Coef), the t-statistic (under T), and the two-sided p-value (under P). If you need a one-sided p-value, divide the reported two-sided value by 2.

Checking Conditions in Detail

Before computing the test statistic or interpreting a p-value, you must verify that the conditions for inference are reasonably met. The AP exam awards substantial credit for explicitly checking these conditions. The mnemonic LINE organizes the four conditions: Linearity, Independence, Normal responses, and Equal variance. A residual plot (residuals vs. x or residuals vs. fitted values) is the single most important diagnostic graphic, as it can reveal violations of three of the four conditions.

Four residual plot scenarios. The left column shows what conditions-met residual plots look like: random scatter with a roughly constant band width. The right column shows common violations—a curved (U-shaped) pattern indicating non-linearity (top right) and a fan-shaped pattern indicating unequal variance (bottom right).
The LINE conditions for inference about the regression slope
ConditionWhat to CheckHow to Check It
L — LinearityThe true relationship between x and y is linear.Residual plot shows no obvious curved pattern; scatterplot of y vs. x appears roughly linear.
I — IndependenceIndividual observations are independent of one another.Justified by study design (e.g., random sampling). If sampling without replacement, check that n < 10% of population.
N — NormalFor each value of x, the response y is normally distributed (equivalently, residuals are normally distributed).Histogram or normal probability plot of residuals shows no strong skewness or outliers. For large n, this condition becomes less critical by the CLT.
E — Equal VarianceThe standard deviation of y (and thus of the residuals) is the same for all values of x.Residual plot shows roughly constant spread (no fan or megaphone shape) across the range of x-values.

Worked Example

A researcher wants to investigate whether there is a linear relationship between the number of hours spent studying and exam score. A random sample of n = 20 students is selected. After performing a least-squares regression analysis, the following computer output is obtained:

Regression output: s = 5.84, R² = 54.6%
PredictorCoefSE CoefTP
Constant52.3403.21016.310.000
Hours3.1700.6824.6480.0002

The residual plot shows random scatter with no discernible pattern, and a histogram of the residuals is roughly symmetric with no outliers. At the α = 0.05 significance level, is there convincing evidence of a linear relationship between hours spent studying and exam score?

Carrying Out the t-Test for the Slope
1
Step 1 — State HypothesesLet β₁ represent the true slope of the population regression line relating hours of study (x) to exam score (y). We test:
H₀: β₁ = 0 (no linear relationship between hours studied and exam score) vs. Hₐ: β₁ ≠ 0 (there is a linear relationship between hours studied and exam score).
2
Step 2 — Check Conditions (LINE)Linearity: The residual plot shows random scatter with no curved pattern, so the linearity condition is satisfied. Independence: The students were randomly selected, and 20 is less than 10% of all students, so the independence condition is satisfied. Normal: The histogram of residuals is approximately symmetric with no outliers, so the normality condition is satisfied. Equal variance: The residual plot shows roughly constant spread across the range of fitted values, so the equal variance condition is satisfied.
All four LINE conditions are met.
3
Step 3 — Compute the Test StatisticFrom the computer output, b₁ = 3.170 and SE(b₁) = 0.682. The test statistic is: t = b₁ / SE(b₁) = 3.170 / 0.682 = 4.648. The degrees of freedom are df = n − 2 = 20 − 2 = 18.
t = 4.648 with df = 18
4
Step 4 — Find the p-ValueSince this is a two-sided test, the p-value = P(|T| ≥ 4.648) with df = 18. From the computer output, the p-value = 0.0002. Alternatively, using a calculator: 2 × tcdf(4.648, 1E99, 18) ≈ 0.0002.
p-value = 0.0002
5
Step 5 — State Conclusion in ContextBecause the p-value (0.0002) is less than α = 0.05, we reject H₀. There is convincing evidence at the α = 0.05 significance level of a linear relationship between the number of hours spent studying and exam score for students in this population. The positive slope (b₁ = 3.170) suggests that, on average, each additional hour of study is associated with an increase of approximately 3.17 points on the exam.
Reject H₀. There is convincing evidence of a positive linear relationship between hours studied and exam score.

Common Pitfalls & Best Practices

Students frequently lose points on the AP exam not because they cannot compute the t-statistic, but because they omit critical steps in communication or misinterpret results. The table below contrasts common mistakes with the correct approach.

Common exam mistakes and their corrections
Common MistakeCorrect Approach
Failing to define β₁ in context—writing only 'H₀: β₁ = 0' without stating what β₁ represents.Always define: 'Let β₁ = the true slope of the population regression line relating [x variable] to [y variable].' Then state H₀ and Hₐ.
Skipping conditions or checking them generically without referencing the data.Explicitly check each LINE condition with specific reference to the residual plot, study design, and sample size.
Using n − 1 degrees of freedom instead of n − 2.The t-test for slope uses df = n − 2 because two parameters (β₀ and β₁) are estimated. This differs from one-sample t-tests.
Concluding 'x causes y' from a significant regression slope.Unless the data come from a randomized experiment, state that there is evidence of an association or linear relationship, not causation.
Writing 'Accept H₀' when the p-value is large.The proper language is 'We fail to reject H₀. There is not convincing evidence of a linear relationship…'
Forgetting to halve the two-sided p-value from output for a one-sided test.If Hₐ is one-sided and the computer reports a two-sided p-value, divide by 2 (only when the sample slope is in the direction specified by Hₐ).
📝 AP EXAM COMMUNICATION
On the AP exam, inference problems are scored holistically across four components: hypotheses, conditions, mechanics (test statistic and p-value), and conclusion in context. Omitting any one of these components typically costs at least one rubric point. Always frame your conclusion using the language of the problem—name the variables, reference the significance level, and state whether the evidence is convincing.

Connections to Confidence Intervals & Beyond

The t-test for the regression slope is closely related to the confidence interval for β₁. In fact, a two-sided hypothesis test at significance level α rejects H₀: β₁ = 0 if and only if the corresponding (1 − α) × 100% confidence interval does not contain 0. Understanding this duality deepens your grasp of both procedures and can serve as a useful cross-check on the AP exam.

Duality between the significance test and confidence interval for the regression slope
FeatureSignificance Test for β₁Confidence Interval for β₁
Question AnsweredIs there evidence that β₁ ≠ 0?What is a plausible range for β₁?
Formulat = b₁ / SE(b₁)b₁ ± t* × SE(b₁)
Outputp-value → reject or fail to reject H₀An interval estimate (lower bound, upper bound)
ConditionsLINE (identical)LINE (identical)
Degrees of Freedomn − 2n − 2
Key RelationshipReject H₀ at level α ↔0 is NOT in the (1 − α) × 100% CI

Looking beyond the AP Statistics curriculum, the regression slope test extends naturally to multiple linear regression, where the model includes multiple explanatory variables and each slope coefficient receives its own t-test. The F-test in ANOVA for regression simultaneously tests whether all slope coefficients are zero. In the simple linear regression case studied here, the F-statistic equals t² and the two tests are equivalent. Understanding the single-predictor case provides essential intuition for more advanced regression modeling in later coursework.

Practice Problems

1
In a t-test for the slope of a regression model, the null hypothesis H₀: β₁ = 0 states that:
2
A regression analysis based on n = 25 observations yields b₁ = 2.40 and SE(b₁) = 0.80. What are the test statistic and degrees of freedom for a t-test of H₀: β₁ = 0?
3
A researcher tests H₀: β₁ = 0 versus Hₐ: β₁ > 0 at α = 0.05. The computer output reports a two-sided p-value of 0.072 and a positive sample slope b₁. Which conclusion is appropriate?
PROBLEM 4APPLIED
An environmental scientist measures the average daily temperature (°F) and the dissolved oxygen concentration (mg/L) in a lake at n = 30 randomly selected times over the course of a year. Computer output from a least-squares regression of dissolved oxygen on temperature yields the following: Predictor Coef SE Coef T P Constant 14.620 0.884 16.54 0.000 Temperature −0.108 0.014 −7.714 0.000 s = 0.721 R² = 68.0% The residual plot shows random scatter with roughly constant spread, and a normal probability plot of the residuals is approximately linear. (a) State the appropriate hypotheses for testing whether there is a negative linear relationship between temperature and dissolved oxygen. (b) Verify that the conditions for inference are met. (c) Identify the test statistic, degrees of freedom, and p-value. Carry out the test. (d) State your conclusion in the context of the study at the α = 0.05 level.
PROBLEM 5CRITICAL THINKING
A statistics student fits a least-squares regression model to a dataset of n = 15 observations and obtains the following partial output: Predictor Coef SE Coef T P Constant 20.50 4.12 — — X 1.75 0.85 — — The student claims: 'Since b₁ = 1.75 is clearly positive, I can conclude there is a significant positive linear relationship. Also, increasing X by 1 unit causes Y to increase by 1.75 units.' (a) Calculate the missing t-statistic and determine the p-value for a two-sided test of H₀: β₁ = 0. Use df = n − 2. (b) At α = 0.05, would you reject H₀? Justify your answer. (c) Identify and explain two errors in the student's reasoning. (d) Describe one condition for inference that, if violated, would make the results of this test unreliable, and explain what diagnostic tool you would use to check it.

Summary & Key Concepts

Carrying out a t-test for the slope of a regression model follows the standard four-step inference framework. Begin by stating hypotheses about the population slope β₁, with H₀: β₁ = 0 asserting no linear relationship and Hₐ specifying the direction of interest. Next, verify the LINE conditions (Linearity, Independence, Normal responses, Equal variance) using a residual plot and knowledge of the study design.

Compute the test statistic t = b₁ / SE(b₁), which follows a t-distribution with n − 2 degrees of freedom under H₀. Obtain the p-value from the t-distribution (halving the two-sided p-value if Hₐ is one-sided), and compare it to the significance level α. If p-value < α, reject H₀ and conclude there is convincing evidence of a linear relationship; otherwise, fail to reject H₀. Always state the conclusion in the context of the problem, and remember that a significant slope from an observational study indicates association, not causation.

Varsity Tutors • AP Statistics • Carrying Out a Test for the Slope of a Regression Model