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
In this lesson you will learn to state the hypotheses, read the t-statistic straight off computer regression output, find a p-value using , 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 β
The standard hypotheses are:The null hypothesis says there is no linear relationship between and in the population — knowing tells you nothing about . The alternative says a linear relationship exists. Most AP questions use the two-sided , but you may use or if the question asks specifically whether the relationship is positive or negative.
A common misconception is writing hypotheses about (the sample slope) or about the correlation . Always write them about the parameter , and always define in context, for example: " 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 is mathematically equivalent to testing whether the population correlation is zero — they give the same t-statistic and p-value.
Checking Conditions (LINER)
| Condition | What to check |
|---|---|
| Linear | Residual plot shows no leftover curved pattern |
| Independent | Random sample / independent observations; 10% condition if sampling without replacement |
| Normal | Residuals roughly normal (histogram/dotplot not strongly skewed) |
| Equal variance | Residual plot has roughly constant spread (no fanning) |
| Random | Data come from a random sample or randomized experiment |
Computing the t-Statistic from Output
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 12.40 | 3.10 | 4.00 | 0.001 |
| x | 2.50 | 0.50 | 5.00 | 0.000 |
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 , so if you run a one-sided test you must halve it.
Finding the p-Value and Concluding
Given and , find the two-sided p-value as the area in both tails: . On the calculator, use tcdf with the appropriate bounds, or read the P column from output for a two-sided test.
Then compare to (usually 0.05) and conclude in context using a template:
If : "Because the p-value of ___ is less than , we reject . We have convincing evidence that the true slope relating and is different from zero (a linear relationship exists)."
If : "Because the p-value of ___ is greater than , we fail to reject . We do not have convincing evidence of a linear relationship."
Never say you "accept" 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
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 , , 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 excludes 0, a two-sided test at will reject , and vice versa. Also be ready to interpret what rejecting means — it means the evidence supports a linear association, not that causes 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 . Hypotheses in a slope test are always statements about .
- Sample slope b.
- The least-squares slope computed from the sample data; the point estimate of , 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 , measuring how many standard errors the sample slope lies from zero.
- Degrees of freedom.
- For a slope test, , 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 were true; compared to to reach a conclusion.
- LINER conditions.
- The inference conditions for regression: Linear, Independent, Normal residuals, Equal variance, Random sampling/assignment.
Worked example
Step 3 — Compute the test statistic.Step 4 — Degrees of freedom and p-value. With , the two-sided p-value is with 18 degrees of freedom. Using tcdf, this gives approximately .
Step 5 — Conclude in context. Because , we reject . 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 students produces output with slope , . Which of the following gives the correct t-statistic and degrees of freedom for testing ?
- ,
- ,
- ,
- ,
Answer: ,
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 , state a complete conclusion in context, and explain what a Type II error would mean here.
Answer: Fail to reject ; 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.
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 .
Answer: One-sided p-value ≈ 0.004; reject and conclude there is convincing evidence the slope is positive.
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 .
- Can I just use the p-value printed in the regression output?
- Yes, for the standard two-sided test — 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 differs from zero; the confidence interval estimates a range of plausible values for . They are consistent: if a 95% interval for excludes 0, a two-sided test at rejects , and if the interval contains 0, the test fails to reject.
- Does rejecting the null hypothesis prove that x causes y?
- No. Rejecting only provides evidence of a linear association between and . 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.