Achievable logoAchievable logo
AP Statistics
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. One variable data
2. Two variable data
3. Data collection
4. Probability and random variables
5. Sampling distributions
6. Categorical data
7. Quantitative data
8. Chi-square
9. Linear regression
9.1 Slope and sampling distribution
9.2 Confidence intervals for a slope of a least squares regression
9.3 Hypothesis test for the slope of a least squares regression
Wrapping up
Achievable logoAchievable logo
9.3 Hypothesis test for the slope of a least squares regression
Achievable AP Statistics
9. Linear regression
Our AP Statistics course is currently in development and is a work-in-progress.

Hypothesis test for the slope of a least squares regression

4 min read
Font
Discuss
Share
Feedback

Significance Test for the Slope of a Regression Line

The hypothesis test for the slope in a least squares regression answers a focused question: does the sample provide convincing evidence of a real linear relationship between x and y in the population, or could the observed trend be due to random chance?

You use the sample slope b to make an inference about the true population slope β.

Definitions

Population Slope (β): The true slope of the linear relationship between x and y in the entire population.

Sample Slope (b): The slope of the least squares regression line calculated from sample data, used as an estimate of β.

Test Statistic (t): A standardized value that measures how many standard errors the sample slope b is away from the hypothesized slope β0​.

Standard Error of the Slope (SEb​): A measure of how much the sample slope is expected to vary across repeated samples. Smaller SEb​ means a more precise estimate of β.

Setting Up the Hypotheses

Before running a test, you need to translate the research question into a pair of hypotheses about the population slope β. The null hypothesis always represents the “no relationship” case (β=0), and the alternative hypothesis describes the kind of relationship you’re looking for — any linear relationship (two-tailed), a positive one, or a negative one. Your choice of alternative depends on the context of the problem and what direction (if any) you have reason to suspect before looking at the data.

Hypotheses

The null hypothesis states that β=0, meaning there is no linear relationship between x and y in the population:

H0​:β=0

The alternative hypothesis is one of the following:

  • Two-tailed test: Ha​:β=0 — there is a linear relationship (positive or negative).
  • One-tailed positive test: Ha​:β>0 — there is a positive linear relationship.
  • One-tailed negative test: Ha​:β<0 — there is a negative linear relationship.

Conditions for the Test

To use this hypothesis test, the following conditions must be met:

  1. Independence: the sample must be random. If sampling is done without replacement, then the sample size n must be less than or equal to 10% of the population size.
  2. Normality: for each x-value, the associated y-values are normally distributed. Recall that if the sample size n≥30, then the central limit theorem applies.
  3. Linearity: the true relationship between x and y is linear.
  4. Equal Standard Deviation: the standard deviation of y is the same for all x-values.

The Test Statistic

To measure how far the sample slope is from the hypothesized population slope (in standard error units), compute:

t=SEb​b−β0​​

Where:

  • t: The test statistic, which measures how many standard errors the sample slope is away from the hypothesized population slope.
  • b: The sample slope from the regression line (y^​=a+bx).
  • β0​: The hypothesized value of the slope from the null hypothesis (typically 0).
  • SEb​: The standard error of the slope. This measures how much the sample slope b varies from sample to sample. A smaller SEb​ means a more precise estimate.

Degrees of freedom: df=n−2.

(spoiler)

Making a Decision

There are two possible ways to make a decision:

Method 1: p-value approach

Use the test statistic t and the degrees of freedom (df=n−2) to find the p-value.

  • If p-value≤α, reject H0​ — there is significant evidence of a linear relationship.
  • If p-value>α, fail to reject H0​ — there is not significant evidence of a linear relationship.

Method 2: Critical value approach

Find the critical t-value from the t-distribution using the degrees of freedom (df=n−2) and the significance level α.

  • For Ha​:β=0: reject H0​ if ∣t∣≥t∗.
  • For Ha​:β>0: reject H0​ if t≥t∗.
  • For Ha​:β<0: reject H0​ if t≤−t∗.

Hypothesis test for regression slope

  • Tests if sample data show a real linear relationship between x and y
  • Uses sample slope b to infer about population slope β

Hypotheses

  • Null hypothesis: β=0 (no linear relationship)
  • Alternative hypothesis:
    • Two-tailed: β=0 (any linear relationship)
    • One-tailed positive: β>0 (positive relationship)
    • One-tailed negative: β<0 (negative relationship)

Conditions for inference

  • Independence: random sample; n≤10% of population if no replacement
  • Normality: y values normal for each x; CLT applies if n≥30
  • Linearity: true x-y relationship is linear
  • Equal standard deviation: constant σy​ for all x

Test statistic

  • Formula: t=SEb​b−β0​​
    • b: sample slope
    • β0​: hypothesized slope (usually 0)
    • SEb​: standard error of the slope
  • Degrees of freedom: df=n−2

Decision methods

  • p-value approach:
    • Reject H0​ if p-value ≤α
    • Fail to reject H0​ if p-value >α
  • Critical value approach:
    • Two-tailed: reject H0​ if ∣t∣≥t∗
    • One-tailed positive: reject H0​ if t≥t∗
    • One-tailed negative: reject H0​ if t≤−t∗

Sign up for free to take 4 quiz questions on this topic

Previous
Next  | Wrapping up
All rights reserved ©2016 - 2026 Achievable, Inc.

Hypothesis test for the slope of a least squares regression

Significance Test for the Slope of a Regression Line

The hypothesis test for the slope in a least squares regression answers a focused question: does the sample provide convincing evidence of a real linear relationship between x and y in the population, or could the observed trend be due to random chance?

You use the sample slope b to make an inference about the true population slope β.

Definitions

Population Slope (β): The true slope of the linear relationship between x and y in the entire population.

Sample Slope (b): The slope of the least squares regression line calculated from sample data, used as an estimate of β.

Test Statistic (t): A standardized value that measures how many standard errors the sample slope b is away from the hypothesized slope β0​.

Standard Error of the Slope (SEb​): A measure of how much the sample slope is expected to vary across repeated samples. Smaller SEb​ means a more precise estimate of β.

Setting Up the Hypotheses

Before running a test, you need to translate the research question into a pair of hypotheses about the population slope β. The null hypothesis always represents the “no relationship” case (β=0), and the alternative hypothesis describes the kind of relationship you’re looking for — any linear relationship (two-tailed), a positive one, or a negative one. Your choice of alternative depends on the context of the problem and what direction (if any) you have reason to suspect before looking at the data.

Hypotheses

The null hypothesis states that β=0, meaning there is no linear relationship between x and y in the population:

H0​:β=0

The alternative hypothesis is one of the following:

  • Two-tailed test: Ha​:β=0 — there is a linear relationship (positive or negative).
  • One-tailed positive test: Ha​:β>0 — there is a positive linear relationship.
  • One-tailed negative test: Ha​:β<0 — there is a negative linear relationship.

Conditions for the Test

To use this hypothesis test, the following conditions must be met:

  1. Independence: the sample must be random. If sampling is done without replacement, then the sample size n must be less than or equal to 10% of the population size.
  2. Normality: for each x-value, the associated y-values are normally distributed. Recall that if the sample size n≥30, then the central limit theorem applies.
  3. Linearity: the true relationship between x and y is linear.
  4. Equal Standard Deviation: the standard deviation of y is the same for all x-values.

The Test Statistic

To measure how far the sample slope is from the hypothesized population slope (in standard error units), compute:

t=SEb​b−β0​​

Where:

  • t: The test statistic, which measures how many standard errors the sample slope is away from the hypothesized population slope.
  • b: The sample slope from the regression line (y^​=a+bx).
  • β0​: The hypothesized value of the slope from the null hypothesis (typically 0).
  • SEb​: The standard error of the slope. This measures how much the sample slope b varies from sample to sample. A smaller SEb​ means a more precise estimate.

Degrees of freedom: df=n−2.

(spoiler)

Making a Decision

There are two possible ways to make a decision:

Method 1: p-value approach

Use the test statistic t and the degrees of freedom (df=n−2) to find the p-value.

  • If p-value≤α, reject H0​ — there is significant evidence of a linear relationship.
  • If p-value>α, fail to reject H0​ — there is not significant evidence of a linear relationship.

Method 2: Critical value approach

Find the critical t-value from the t-distribution using the degrees of freedom (df=n−2) and the significance level α.

  • For Ha​:β=0: reject H0​ if ∣t∣≥t∗.
  • For Ha​:β>0: reject H0​ if t≥t∗.
  • For Ha​:β<0: reject H0​ if t≤−t∗.
Key points

Hypothesis test for regression slope

  • Tests if sample data show a real linear relationship between x and y
  • Uses sample slope b to infer about population slope β

Hypotheses

  • Null hypothesis: β=0 (no linear relationship)
  • Alternative hypothesis:
    • Two-tailed: β=0 (any linear relationship)
    • One-tailed positive: β>0 (positive relationship)
    • One-tailed negative: β<0 (negative relationship)

Conditions for inference

  • Independence: random sample; n≤10% of population if no replacement
  • Normality: y values normal for each x; CLT applies if n≥30
  • Linearity: true x-y relationship is linear
  • Equal standard deviation: constant σy​ for all x

Test statistic

  • Formula: t=SEb​b−β0​​
    • b: sample slope
    • β0​: hypothesized slope (usually 0)
    • SEb​: standard error of the slope
  • Degrees of freedom: df=n−2

Decision methods

  • p-value approach:
    • Reject H0​ if p-value ≤α
    • Fail to reject H0​ if p-value >α
  • Critical value approach:
    • Two-tailed: reject H0​ if ∣t∣≥t∗
    • One-tailed positive: reject H0​ if t≥t∗
    • One-tailed negative: reject H0​ if t≤−t∗

More from Linear regression

  • Slope and sampling distribution
  • Confidence intervals for a slope of a least squares regression