AP-STATS-9.4-9.5

U9.4 t-Test for Slope

Master the AP Statistics t-test for slope: set up hypotheses about β, compute the t-statistic from regression output, find the p-value with df = n − 2, and conclude in context.

What you'll do in this lesson

A voice-first session with the Crimsora tutor on U9.4 t-Test for Slope, then targeted practice and FRQs — with the tutor adapting to where you get stuck.

What this lesson covers

When you fit a least-squares line to sample data, the slope you calculate is just an estimate. A different sample would give a slightly different slope. So how do you know the linear relationship you see is real and not just random noise? The t-test for slope answers exactly that question. It tests whether the true population slope β\beta is different from zero — meaning whether the explanatory variable genuinely helps predict the response.

In this lesson you will learn to state the hypotheses, read the t-statistic straight off computer regression output, find a p-value using df=n2df = n-2, and write a conclusion that earns full credit on the AP exam. This is one of the most predictable inference procedures the exam tests, so getting the mechanics automatic pays off.

Setting Up Hypotheses About β

Every slope test is a claim about the population slope β\beta — the slope of the true regression line for the entire population, which we estimate with the sample slope bb (often written β^\hat{\beta} or b1b_1).

The standard hypotheses are:H0:β=0Ha:β0H_0: \beta = 0 \qquad H_a: \beta \neq 0The null hypothesis says there is no linear relationship between xx and yy in the population — knowing xx tells you nothing about yy. The alternative says a linear relationship exists. Most AP questions use the two-sided β0\beta \neq 0, but you may use β>0\beta > 0 or β<0\beta < 0 if the question asks specifically whether the relationship is positive or negative.

A common misconception is writing hypotheses about bb (the sample slope) or about the correlation rr. Always write them about the parameter β\beta, and always define β\beta in context, for example: "β\beta is the true slope relating study hours to exam score." Failing to state hypotheses in terms of the population parameter is a frequent point loss. Note that testing β=0\beta = 0 is mathematically equivalent to testing whether the population correlation is zero — they give the same t-statistic and p-value.

Checking Conditions (LINER)

Before running the test you must verify inference conditions, remembered by the acronym LINER:
ConditionWhat to check
LinearResidual plot shows no leftover curved pattern
IndependentRandom sample / independent observations; 10% condition if sampling without replacement
NormalResiduals roughly normal (histogram/dotplot not strongly skewed)
Equal varianceResidual plot has roughly constant spread (no fanning)
RandomData come from a random sample or randomized experiment
On the AP exam you rarely have raw data to build a residual plot from scratch during a slope test; often you are told the conditions are met or given the plots. State that each condition is satisfied and briefly cite the evidence. The most tested idea here is reading a residual plot: a fan shape violates equal variance, and a curved pattern violates linearity. If a condition is clearly violated, you should note it, but the AP typically sets up problems where inference is appropriate so you can proceed to the test.

Computing the t-Statistic from Output

The test statistic follows the same logic as every t-test: how many standard errors is the estimate from the hypothesized value?t=bβ0SEb=b0SEbt = \frac{b - \beta_0}{SE_b} = \frac{b - 0}{SE_b}Here bb is the sample slope and SEbSE_b is its standard error. Both come directly from standard computer regression output. Learn to read the output table:
PredictorCoefSE CoefTP
Constant12.403.104.000.001
x2.500.505.000.000
The slope row (the predictor row, not "Constant") gives b=2.50b = 2.50, SEb=0.50SE_b = 0.50, t=5.00t = 5.00. The software already computed t=2.50/0.50=5.00t = 2.50/0.50 = 5.00. You usually just report it, but be ready to compute it if only bb and SEbSE_b are given.

A classic trap: students grab the constant/intercept row instead of the slope row. Always use the row labeled with the explanatory variable's name. Another trap is using the reported P-value blindly — that software p-value is for the two-sided test β0\beta \neq 0, so if you run a one-sided test you must halve it.

Finding the p-Value and Concluding

The degrees of freedom for a slope test are:df=n2df = n - 2where nn is the number of (x,y)(x,y) data points. You subtract 2 because the line estimates two parameters (slope and intercept). This is different from the n1n-1 you used earlier for means, so watch it carefully.

Given tt and dfdf, find the two-sided p-value as the area in both tails: p=2P(Tt)p = 2P(T \geq |t|). On the calculator, use tcdf with the appropriate bounds, or read the P column from output for a two-sided test.

Then compare to α\alpha (usually 0.05) and conclude in context using a template:

If p<αp < \alpha: "Because the p-value of ___ is less than α=0.05\alpha = 0.05, we reject H0H_0. We have convincing evidence that the true slope relating xx and yy is different from zero (a linear relationship exists)."

If pαp \geq \alpha: "Because the p-value of ___ is greater than α\alpha, we fail to reject H0H_0. We do not have convincing evidence of a linear relationship."

Never say you "accept" H0H_0 or that you have "proven" a relationship. Conclusions must reference the context (the actual variables), the p-value, and the significance level.

How the Exam Tests This

The slope test appears in both multiple-choice and free-response. In multiple-choice you are typically given regression output and asked for the correct df, the correct t-statistic, or the correct conclusion. Remember df=n2df = n - 2 and that the output p-value is two-sided.

In free-response, the four-step inference framework earns the points: State the hypotheses and parameter, Plan by naming the procedure (t-test for the slope of a regression line) and checking conditions, Do by computing or reporting tt, dfdf, and the p-value, and Conclude in context linked to the p-value.

A frequent follow-up asks you to connect the test to a confidence interval for the slope (taught in the neighboring lesson): if a 95% confidence interval for β\beta excludes 0, a two-sided test at α=0.05\alpha = 0.05 will reject H0H_0, and vice versa. Also be ready to interpret what rejecting H0H_0 means — it means the evidence supports a linear association, not that xx causes yy unless the data came from a randomized experiment.

Key terms

Population slope β.
The slope of the true regression line for the entire population, estimated by the sample slope bb. Hypotheses in a slope test are always statements about β\beta.
Sample slope b.
The least-squares slope computed from the sample data; the point estimate of β\beta, found in the predictor row of regression output.
Standard error of the slope (SE_b).
A measure of how much the sample slope would vary from sample to sample; the denominator of the t-statistic, read from the SE Coef column.
t-statistic.
The standardized test statistic t=(b0)/SEbt = (b - 0)/SE_b, measuring how many standard errors the sample slope lies from zero.
Degrees of freedom.
For a slope test, df=n2df = n - 2, because the regression line estimates two parameters (slope and intercept).
p-value.
The probability of getting a slope estimate at least as extreme as observed if H0:β=0H_0: \beta = 0 were true; compared to α\alpha to reach a conclusion.
LINER conditions.
The inference conditions for regression: Linear, Independent, Normal residuals, Equal variance, Random sampling/assignment.

Worked example

A researcher collects data on n=20n = 20 used cars, regressing price (in thousands of dollars) on mileage (in thousands of miles). Software output gives the mileage slope b=0.075b = -0.075 with SEb=0.021SE_b = 0.021. Conditions for inference are met. At α=0.05\alpha = 0.05, is there convincing evidence of a linear relationship between mileage and price?
Step 1 — State hypotheses. Let β\beta be the true slope relating mileage to price for used cars of this type.H0:β=0Ha:β0H_0: \beta = 0 \qquad H_a: \beta \neq 0Step 2 — Name procedure and conditions. We use a t-test for the slope of a regression line. The problem states LINER conditions are satisfied, so we proceed.

Step 3 — Compute the test statistic.t=b0SEb=0.0750.0213.57t = \frac{b - 0}{SE_b} = \frac{-0.075}{0.021} \approx -3.57Step 4 — Degrees of freedom and p-value. With df=n2=202=18df = n - 2 = 20 - 2 = 18, the two-sided p-value is p=2P(T3.57)p = 2P(T \leq -3.57) with 18 degrees of freedom. Using tcdf, this gives approximately p0.0022p \approx 0.0022.

Step 5 — Conclude in context. Because p0.0022<0.05p \approx 0.0022 < 0.05, we reject H0H_0. We have convincing evidence that the true slope relating mileage to price is different from zero — that is, there is a statistically significant linear relationship between a used car's mileage and its price. The negative slope indicates that higher mileage is associated with lower price.

Practice questions

A regression of exam score on hours studied for n=15n = 15 students produces output with slope b=4.2b = 4.2, SEb=1.5SE_b = 1.5. Which of the following gives the correct t-statistic and degrees of freedom for testing H0:β=0H_0: \beta = 0?
  1. t=2.80t = 2.80, df=13df = 13
  2. t=2.80t = 2.80, df=14df = 14
  3. t=0.36t = 0.36, df=13df = 13
  4. t=6.30t = 6.30, df=15df = 15

Answer: t=2.80t = 2.80, df=13df = 13

The t-statistic is t=b/SEb=4.2/1.5=2.80t = b/SE_b = 4.2/1.5 = 2.80. Degrees of freedom for a slope test are df=n2=152=13df = n - 2 = 15 - 2 = 13. Choice with df=14df=14 uses the mean formula n1n-1 incorrectly; the t=0.36t=0.36 option inverts the ratio; t=6.30t=6.30 multiplies instead of divides.
A biologist regresses plant height on the amount of fertilizer applied using data from 25 randomly selected plants. The software reports a slope of 0.62 with a two-sided p-value of 0.18. Using α=0.05\alpha = 0.05, state a complete conclusion in context, and explain what a Type II error would mean here.

Answer: Fail to reject H0H_0; there is not convincing evidence of a linear relationship between fertilizer amount and plant height. A Type II error would mean concluding no relationship exists when in fact fertilizer truly does have a linear effect on height.

Since p=0.18>0.05p = 0.18 > 0.05, we fail to reject H0:β=0H_0: \beta = 0. We do not have convincing evidence that the true slope differs from zero, so we cannot conclude fertilizer is linearly related to height. We never 'accept' the null. A Type II error is failing to reject a false null — here, missing a real relationship between fertilizer and height. This teaches that a large p-value means insufficient evidence, not proof of no effect.
Regression output for predicting weekly sales from advertising spending (n = 30) shows a slope of 3.4 with a two-sided p-value of 0.008. A manager wants to test only whether the slope is positive. Report the appropriate p-value and conclusion at α=0.05\alpha = 0.05.

Answer: One-sided p-value ≈ 0.004; reject H0H_0 and conclude there is convincing evidence the slope is positive.

For a one-sided test Ha:β>0H_a: \beta > 0, halve the two-sided software p-value: 0.008/2=0.0040.008/2 = 0.004, valid because the observed slope (3.4) is in the direction of HaH_a. Since 0.004<0.050.004 < 0.05, reject H0H_0; there is convincing evidence that increased advertising spending is associated with higher weekly sales. This reinforces that software p-values are two-sided and must be adjusted for one-sided tests.

FAQ

Why is df = n − 2 for a slope test instead of n − 1?
A regression line estimates two parameters from the data — the slope and the intercept. Each estimated parameter costs one degree of freedom, so you subtract 2 from the sample size. This differs from a one-sample t-test for a mean, which estimates only one parameter and uses df=n1df = n - 1.
Can I just use the p-value printed in the regression output?
Yes, for the standard two-sided test Ha:β0H_a: \beta \neq 0 — that printed P-value is exactly what you want. But if you are running a one-sided test, you must halve the printed value (provided the sample slope is in the direction of your alternative).
What's the difference between the slope test and the confidence interval for slope?
They answer related questions. The t-test decides whether β\beta differs from zero; the confidence interval estimates a range of plausible values for β\beta. They are consistent: if a 95% interval for β\beta excludes 0, a two-sided test at α=0.05\alpha = 0.05 rejects H0H_0, and if the interval contains 0, the test fails to reject.
Does rejecting the null hypothesis prove that x causes y?
No. Rejecting H0H_0 only provides evidence of a linear association between xx and yy. Causation can only be inferred if the data came from a well-designed randomized experiment. Observational data can show a significant slope even when a lurking variable drives the relationship.

Learn this with a teacher, not a page

The Crimsora tutor teaches U9.4 t-Test for Slope live — explaining on a whiteboard, asking you questions, and adapting to where you get stuck.