Fiveable

📊AP Statistics Unit 9 Review

QR code for AP Statistics practice questions

9.5 Carrying Out a Test for the Slope of a Regression Model

📊AP Statistics
Unit 9 Review

9.5 Carrying Out a Test for the Slope of a Regression Model

Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examWritten by the Fiveable Content Team • Last updated September 2025
📊AP Statistics
Unit & Topic Study Guides
Pep mascot

As we finished out on Section 9.4, we have set up the test for slope of a regression model, now we have to calculate our test statistics and make our conclusion.

If the assumptions of a linear regression model are satisfied and the null hypothesis is true, the distribution of the slope estimate is a t-distribution. Specifically, the slope estimate follows a t-distribution with n-2 degrees of freedom, where n is the sample size. This follows from the Central Limit Theorem and the fact that the slope estimate is a linear combination of the observations.

T-Score

The first thing we need to calculate is our critical value (or t-score). Our t-score can tell us how far away from the mean (null slope value) our sample is, so it gives us a scale to see how close our sample is to the expected slope value.

The formula to compute our t-score is similar to any other critical value. We must take our observed value, subtract the expected value and then divide the result by the standard deviation. 

t = (b - β)/SE of b

In this case, we are going to base our t-score off of our degrees of freedom being n-2. When there is only one parameter we are testing, we will use n-1 as our degrees of freedom.

Pep mascot
more resources to help you study

P-Value

The next, and most important statistic that we need to calculate is the p-value. Our p-value is the probability that our particular slope occurs if we assume the null slope (usually 0).

Image Taken From Stats Online

In the example above, our t score came out to be 2.0791 with 21 degrees of freedom. Therefore, since we are performing a two-tailed test, our p-value comes out to be 0.5 (typically your t score and p-value don’t come out to be exactly our significance level). Therefore, there is approximately a 5% chance of obtaining our given sample, assuming that the null slope of 0 is true. A 5% chance of something happening by random chance is pretty low, therefore, we would reject our null hypothesis in favor of the alternate due to the evidence from our sample.

Concluding Your Test and Response Templates

Once you have your t-score and p-value from your calculations, you are ready to conclude your test. As in with any other inference procedure you have performed, your conclusion is primarily based on your p-value that was obtained from your t-distribution and t-score.

If the p is lower than your significance level:

  • "Since our p value is less than our significance level, we reject our Ho. We have significant evidence that the true slope of the regression line between ________ and ______ is (value in alternate hypothesis, usually not 0)."

If the p is not lower than your significance level:

  • "Since our p value is more than our significance level, we fail to reject our Ho. We do not have significant evidence that the true slope of the regression line between ________ and ______ is (value in alternate hypothesis, usually not 0)."

For more practice on this concept and to see a problem worked through completely, move on to Section 9.6!

Practice Problem

You are a researcher studying the relationship between income and happiness. You collect data on income and happiness scores for a sample of 50 individuals. You want to test whether there is a statistically significant linear relationship between these two variables.

You decide to use a t-test for the slope of the regression line to test the following null and alternative hypotheses:

H0: There is no linear relationship between income and happiness (i.e., the slope of the regression line is equal to 0).

Ha: There is a linear relationship between income and happiness (i.e., the slope of the regression line is not equal to 0).

You compute the t-statistic for the slope and find that it has a value of 2.5. The degrees of freedom for the t-distribution are 48 (since the sample size is 50 and there are two variables).

Based on the t-statistic and the degrees of freedom, you compute the p-value for the test. The p-value is the probability of obtaining a t-statistic as extreme as or more extreme than the observed t-statistic, given that the null hypothesis is true.

After performing the t-test, you find that the p-value is 0.01. You use a significance level of 0.05.

What is your conclusion about the null hypothesis? Explain your reasoning.

Answer

In this case, the p-value of 0.01 is less than the significance level of 0.05, so you would reject the null hypothesis that there is no linear relationship between income and happiness. This indicates that there is sufficient evidence to support the alternative hypothesis that there is a linear relationship between these two variables.

Your reasoning for rejecting the null hypothesis would be based on the fact that the p-value is less than the significance level. The p-value represents the probability of obtaining a t-statistic as extreme as or more extreme than the observed t-statistic, given that the null hypothesis is true. If this probability is low, it suggests that the observed t-statistic is unlikely to have occurred by chance, and therefore the null hypothesis is likely to be false. In this case, the low p-value of 0.01 indicates that the observed t-statistic of 2.5 is unlikely to have occurred by chance, and therefore the null hypothesis should be rejected.

Vocabulary

The following words are mentioned explicitly in the College Board Course and Exam Description for this topic.

TermDefinition
degrees of freedomA parameter of the t-distribution that affects its shape; as degrees of freedom increase, the t-distribution approaches the normal distribution.
null distributionThe probability distribution of the test statistic under the assumption that the null hypothesis is true.
null hypothesisThe initial claim or assumption being tested in a hypothesis test, typically stating that there is no effect or no difference.
p-valueThe probability of observing a test statistic as extreme as or more extreme than the one calculated from the sample data, assuming the null hypothesis is true.
population regression lineThe true linear relationship μy = α + βx between the response and explanatory variables in the entire population.
regression modelA statistical model that describes the relationship between a response variable (y) and one or more explanatory variables (x).
reject the null hypothesisThe decision made when the p-value is less than or equal to the significance level, indicating sufficient evidence against the null hypothesis.
sampling distributionThe probability distribution of a sample statistic (such as a sample proportion) obtained from repeated sampling of a population.
significance levelThe threshold probability (α) used to determine whether to reject the null hypothesis in a significance test.
significance testA statistical procedure used to determine whether there is sufficient evidence to reject the null hypothesis based on sample data.
simple linear regressionA regression model that describes the linear relationship between one explanatory variable and one response variable.
slopeThe value b in the regression equation ŷ = a + bx, representing the rate of change in the predicted response for each unit increase in the explanatory variable.
slope of a regression modelThe coefficient that represents the rate of change in the predicted response variable for each unit increase in the explanatory variable in a linear regression equation.
standard errorThe standard deviation of a sampling distribution, which measures the variability of a sample statistic across repeated samples.
t-distributionA probability distribution used when the population standard deviation is unknown and the sample standard deviation is used instead, characterized by heavier tails than the normal distribution.
test statisticA calculated value used to determine whether to reject the null hypothesis in a hypothesis test, computed from sample data.

Frequently Asked Questions

How do I calculate the test statistic for testing the slope of a regression line?

Use the t statistic t = (b − β0) / SEb where b is your sample slope (least-squares estimate), β0 is the slope in H0 (usually 0), and SEb is the standard error of b. Under the CED assumptions the null distribution is a t with df = n − 2. How to get SEb: - From software/calculator: it’s the “SE Coef” for the slope. - By formula (from the formula sheet): SEb = s / (sx · sqrt(n − 1)), where s = sqrt[ Σ(y − ŷ)² / (n − 2) ] (the residual standard error) and sx = sample standard deviation of x. Check conditions first: linearity, independent random sampling/experiment, roughly normal residuals for each x, and constant variance (homoscedasticity). After computing t, find the p-value from t(df = n − 2) and compare to α to reject/fail to reject. For a quick AP review see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and practice problems (https://library.fiveable.me/practice/ap-statistics).

What's the formula for the t-test when testing if a slope equals zero?

The t-statistic for testing a regression slope is t = (b − β0) / SE_b, where b is the least-squares slope, β0 is the slope under H0 (often 0), and SE_b is the standard error of b. For the common test H0: β = 0 this simplifies to t = b / SE_b. Under the regression inference conditions (linear relationship, independent observations, constant variance, normal residuals) this t follows a t-distribution with df = n − 2. Compare the p-value from that t to your α to decide (p ≤ α → reject H0). For review and AP-aligned examples see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and more practice problems (https://library.fiveable.me/practice/ap-statistics).

When do I use a t-distribution vs normal distribution for regression slope tests?

Use a t-distribution for tests about the slope in simple linear regression—not a normal (z)—because the slope’s standard error uses the sample residual SD (s), not the true σ. Under the AP CED conditions (linearity, independence, normality of residuals for each x, and constant variance), the null distribution of t = (b − β0)/SEb follows a t-distribution with df = n − 2. So on the exam you always use that t (and Table B or your calculator) when testing H0: β = β0. When would you ever use a normal? Practically never for slope tests in AP Stats, since σ is unknown; z is for cases where the sampling distribution’s standard deviation is known (e.g., some large-sample proportion z-tests). For extra review, see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and practice questions (https://library.fiveable.me/practice/ap-statistics).

I'm confused about degrees of freedom for slope tests - is it n-1 or n-2?

Short answer: for a simple linear regression slope test you use df = n − 2. Why: the t statistic for the slope t = (b − β0) / SEb follows a t distribution with n − 2 degrees of freedom because two parameters (the slope and the intercept) are estimated from the n data points. The AP CED’s VAR-7.M.2 explicitly gives df = n − 2 for the sampling distribution of that t statistic. (The n − 1 df shows up for one-sample t tests for a mean because you estimate just one parameter, the mean.) Make sure you’ve checked the regression conditions (linearity, independence, normality of residuals, constant variance) before trusting the t test. For a concise AP review, see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and use practice problems at (https://library.fiveable.me/practice/ap-statistics).

What's the difference between testing a slope and testing a correlation coefficient?

Testing a slope (β) and testing a correlation coefficient (r) are closely related but not the same. For slope tests you’re asking whether the population regression coefficient β equals some value (usually 0). You use the least-squares estimate b, its standard error SEb, and the t-statistic t = (b − β0)/SEb with df = n − 2 (CED VAR-7.M). The p-value is computed assuming H0 is true and tells you how likely your b is under that null (DAT-3.M, DAT-3.N). Testing correlation often uses r (sample correlation) to ask if the population correlation ρ = 0. You can convert r to a t (or use Fisher z) and get the same conclusion for simple linear regression: testing β = 0 is equivalent to testing ρ = 0. The difference is conceptual: slope tests directly address change in y per unit x (units matter); correlation tests address strength/direction of linear association (unitless). For AP exam practice, see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and more practice questions (https://library.fiveable.me/practice/ap-statistics).

Can someone explain step by step how to do a significance test for regression slope?

Step-by-step (quick): 1. State hypotheses in context. Usually H0: β = 0 (no linear relationship) vs Ha: β ≠ 0, >0, or <0. 2. Check conditions: linearity, independence/random sampling, equal variance (homoscedasticity), and approximate normality of residuals. If these fail, results aren’t reliable. 3. Compute the test statistic: t = (b − β0) / SEb. For most AP problems β0 = 0. b is the sample slope; SEb is the standard error from your regression output. 4. Degrees of freedom: use df = n − 2 for simple linear regression. 5. Find the p-value from the t-distribution (two-sided or one-sided depending on Ha). Compare p to α (commonly 0.05). If p ≤ α, reject H0; if p > α, fail to reject H0. 6. State a conclusion in context: what the result says about the population slope. Interpret the p-value as the chance of getting a slope as extreme as b assuming H0 is true. For more stepwise examples, see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8). Practice problems are at (https://library.fiveable.me/practice/ap-statistics).

How do I interpret the p-value when testing if there's a linear relationship between two variables?

The p-value tells you how surprising your sample slope b is if the null hypothesis about the population slope β is true. For a slope test you compute t = (b − β0)/SEb and (under the regression conditions) compare that t to a t-distribution (df ≈ n−2). The p-value is the probability of seeing a t as extreme as yours assuming H0: β = β0 is true. Small p-value (≤ α) → reject H0: there’s strong evidence of a linear relationship (β ≠ β0 or directional alternative). Large p-value (> α) → fail to reject H0: the data don’t provide convincing evidence of a linear relationship. Always state your conclusion in context (mention “slope” or “linear relationship”), check assumptions (linearity, independence, normal residuals, constant variance), and compare p to α explicitly. Want practice? Review Topic 9.5 (study guide) here: (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and try problems at (https://library.fiveable.me/practice/ap-statistics).

What does it mean when we assume the null hypothesis is true for slope tests?

Assuming the null hypothesis is true for a slope test means you temporarily act as if the population slope β equals the value in H0 (usually β0 = 0). You use that assumption to figure out the null (sampling) distribution of the slope estimator b—specifically the t-statistic t = (b − β0)/SEb—and, under the regression conditions, that t follows a t-distribution (use df ≈ n − 2 for simple linear regression). The p-value is then the probability, computed from that t-distribution, of seeing a t as extreme as (or more extreme than) the one from your sample if H0 really were true. If the p-value ≤ α you reject H0; if > α you fail to reject H0. That’s why checking linearity, normal residuals, constant variance, and independence matters: they justify using the t null distribution (CED VAR-7.M, DAT-3.M/N). For a quick topic review, see the Fiveable study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and more practice (https://library.fiveable.me/practice/ap-statistics).

I don't understand when to reject or fail to reject the null hypothesis for slope tests - how do I compare p-value to alpha?

Compare the p-value to your chosen significance level α—that’s the whole decision. By the CED rule (DAT-3.N.1): if p ≤ α, reject H0: β = β0 (you have statistically significant evidence that the true slope differs from β0); if p > α, fail to reject H0 (the data don’t provide convincing evidence against β0). Remember the p-value is computed assuming H0 is true (DAT-3.M.1), so it measures how unlikely the observed slope (or more extreme) would be under H0. For slope tests use the t statistic t = (b − β0)/SEb with df = n − 2 (VAR-7.M.2). On the AP exam you’ll explicitly state the comparison p vs. α and give a context sentence about the slope. Need a refresher? See the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and try practice problems (https://library.fiveable.me/practice/ap-statistics).

How do I know if my regression slope is statistically significant?

You check significance by doing a t-test on the slope. Steps (quick): - Compute b (sample slope) and its SE, SEb. - Form t = (b − β0)/SEb. For the usual H0: β = 0 use β0 = 0. - Under the CED assumptions the test statistic follows a t-distribution with df = n − 2, so find the p-value from that t (two-sided if Ha: β ≠ 0; one-sided if Ha is directional). CED reminder: the null distribution is t and df = n − 2 for simple linear regression. - Decision: if p ≤ α reject H0 (slope is statistically significant); if p > α fail to reject H0. Also verify conditions first: linear relationship, independent observations, residuals approximately normal for each x, and constant variance (homoscedasticity). For AP-aligned review and worked examples see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8). For extra practice, use the unit review (https://library.fiveable.me/ap-statistics/unit-9) and thousands of practice problems (https://library.fiveable.me/practice/ap-statistics).

What are the conditions I need to check before doing a t-test for the slope?

Before you run the t-test for the slope, check these conditions (AP CED keywords): - Randomness/independence: data come from a random sample or a randomized experiment; if sampling without replacement, sample ≤ 10% of the population. - Linearity: the true relationship between x and y is (approximately) linear—check the scatterplot. - Normality of residuals: for each x, the distribution of residuals (y − ŷ) is roughly normal—check residual histogram or normal probability plot. - Constant variance (homoscedasticity): the spread of residuals is about the same for all x—check residuals vs. fitted values (no funnel shape). If these hold, the test statistic t = (b − β0) / SEb follows a t-distribution with df = n − 2 and you can compare the p-value to α (CED VAR-7.M, DAT-3). For quick review see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8). Need practice? Try problems at (https://library.fiveable.me/practice/ap-statistics).

Why do we use t=(b-β)/SEb as our test statistic formula?

Because any inference compares what you observed (the sample slope b) to what the null says the true slope is (β). Standardizing that difference gives a single number you can use with a known distribution: t = (b − β) / SEb. That follows the general form on the formula sheet: (statistic − parameter) / (standard error of the statistic). Under the regression conditions (linearity, independent random sampling, constant variance, normal residuals) the sampling distribution of b is approximately t-shaped, so this standardized value has a t-distribution (df = n − 2 for simple linear regression). That t-value tells you how many standard errors your observed slope is from the null slope; larger |t| → less likely under H0 → small p-value. For AP prep, see Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and try practice problems (https://library.fiveable.me/practice/ap-statistics).

How do I find the standard error of the slope on my calculator?

On a TI-84 (or similar graphing calculator) the easiest way is to run the t-test for a regression—the calculator prints the slope estimate b and its standard error Sb. Quick steps: 1. Enter x in L1 and y in L2 (Stat → Edit). 2. Turn on diagnostics (2nd → 0 → DiagnosticOn → Enter) so the calculator shows test stats. 3. Run LinRegTTest: Stat → Tests → LinRegTTest. Choose Data (L1, L2) or Stats if you have summary values. 4. Press Calculate. The output shows: b (sample slope), Sb (standard error of b), t (t statistic) and p (p-value). Sb is the SEb you use in t = (b − β0)/SEb and for CIs. Remember AP rules: you may use a graphing calculator on the exam and you’ll report SEb and use df = n−2 for inference on the slope (CED VAR-7.M). For a how-to refresher see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8). For extra practice problems, check Fiveable’s practice set (https://library.fiveable.me/practice/ap-statistics).

What's the null and alternative hypothesis when testing if there's no linear relationship?

Null: H0: β = 0. Alternative (two-sided): Ha: β ≠ 0. Why: “No linear relationship” means the population slope β is zero. On the AP exam you’ll usually test H0: β = 0 using the t-statistic t = (b − β0)/SEb, which (when conditions are met) follows a t-distribution with df = n − 2. Compare the p-value (computed assuming H0 true) to your α: if p ≤ α, reject H0 and conclude there’s evidence of a linear relationship; if p > α, fail to reject H0. If the research question is directional, use a one-sided Ha (β > 0 or β < 0) instead. For a short refresher on carrying out this slope test and practice problems, see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and the Unit 9 overview (https://library.fiveable.me/ap-statistics/unit-9). For more practice, check the AP Stats practice bank (https://library.fiveable.me/practice/ap-statistics).

I keep getting confused about whether to use one-tailed or two-tailed tests for regression slopes - which one do I use?

Use the alternative hypothesis that matches the research question. There’s no fixed rule that regression slope tests must be one- or two-tailed—you pick the tail based on what you’re trying to show. - If you just want to know whether there’s any linear relationship (increase or decrease), use a two-tailed test: H0: β = 0 vs Ha: β ≠ 0. This is the most common on the AP exam. - If your question predicts a direction, use a one-tailed test: H0: β = 0 vs Ha: β > 0 (predicts a positive slope) or Ha: β < 0 (predicts a negative slope). Compute t = (b − β0)/SEb and use the t distribution (df = n − 2 for simple linear regression per the CED VAR-7.M.2). Compare the p-value to α: if p ≤ α, reject H0; otherwise fail to reject (DAT-3.N). For practice and worked examples see the Topic 9.5 study guide (https://library.fiveable.me/ap-statistics/unit-9/carrying-out-test-for-slope-regression-model/study-guide/NZoM7ZudTv9aH60Y5hn8) and try more problems at (https://library.fiveable.me/practice/ap-statistics).