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.2 Confidence intervals for a 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.

Confidence intervals for a slope of a least squares regression

7 min read
Font
Discuss
Share
Feedback

Confidence Intervals for the Slope of a Regression Line

When we fit a least squares regression line to sample data, the slope b we calculate is just an estimate of the true population slope β. Since the slope can vary from sample to sample, we use a confidence interval to estimate a plausible range of values for the true slope β.

Definitions

Least Squares Regression Line: A straight line y^​=a+bx that models the relationship between an explanatory variable x and a response variable y, chosen to minimize the sum of squared residuals.

Sample Slope (b): The slope of the regression line calculated from the sample data — used to estimate β.

Population Slope (β): The true slope of the linear relationship in the population.

Standard Error of the Slope (SEb​): A measure of how much the sample slope is expected to vary from sample to sample.

Confidence Interval for the Slope: A range of plausible values for the true population slope β, computed at a chosen confidence level.

Recall: What is the least squares regression line?

The least squares regression line is a straight line that models the relationship between a quantitative explanatory (independent) variable x and a quantitative response (dependent) variable y.

It’s chosen to minimize the sum of the squared vertical distances (residuals) between the observed data points and the line.

The equation of the least squares regression line is y^​=a+bx where:

  • y^​ is the predicted value of y for a given x.
  • a is the y-intercept.
  • b is the slope.

The slope tells you the estimated change in the response variable y for each one-unit increase in the explanatory variable x. For example, if a regression predicts a student’s final exam score (y) from hours studied (x) and the slope is 3, then each additional hour studied is associated with a predicted increase of 3 points in the exam score.

The slope b is computed from sample data, so it can vary from sample to sample. In inference, the goal is to learn about the true population slope, typically written as β. A confidence interval helps you estimate a plausible range of values for that true slope.

Key Equation: Confidence Interval for the Slope

b±t∗×SEb​

Where:

  • b — slope of the least squares regression line
  • SEb​ — standard error of the slope
  • n — sample size
  • df=n−2

Example 1

A statistics professor investigates the relationship between the number of hours students spent studying for a final exam and their exam scores. Data from a random sample of 15 students is collected. The least squares regression line calculated from the sample data is:

y^​=55.2+3.4x

Where y^​ is the predicted exam score and x is the number of hours studied. The standard error is SEb​=0.85. Assume that all the conditions for inference (linearity, constant variability, and normality) have been met.

Part a. Interpret the slope of the least squares regression line in the context of the problem.

The slope is the coefficient of x, which is 3.4.

(spoiler)

For each additional hour studied, the model predicts an average increase of 3.4 points in the exam score.

Part b. Calculate the 95% confidence interval for the true slope.

Recall the general formula for the confidence interval of the slope:

b±t∗×SEb​

From the problem:

  • b=3.4
  • SEb​=0.85
  • n=15

Find the critical t-value t∗.

Degrees of freedom: df=n−2=15−2=13. For a 95% confidence level and df=13, the critical value is t∗=2.160.

Calculate the margin of error and endpoints.

MELowerUpper​=t∗×SEb​=2.160×0.85=1.836=3.4−1.836=1.564=3.4+1.836=5.236​

(spoiler)

The 95% confidence interval is (1.564,5.236).

Part c. Interpret the interval in context.

(spoiler)

We are 95% confident that the interval from 1.564 to 5.236 contains the true population slope. In context, this suggests that for each additional hour studied, the true average exam score increases by between about 1.6 and 5.2 points.

Part d. Is there statistically significant evidence that there is a linear relationship between the study time and the exam score? Why or why not?

To check for evidence of a linear relationship, focus on whether β=0 (no linear relationship) is a plausible value for the slope. The 95% confidence interval from Part b is (1.564,5.236).

(spoiler)

Yes. Because the entire interval is above 0, β=0 is not plausible at the 5% significance level. This provides statistically significant evidence of a positive linear relationship between study time and exam scores.

Example 2

Information concerning the number of years of work experience and annual salary (in thousands of dollars) was collected from 18 randomly selected employees at a large company. A linear regression performed on the data using a statistical software package produced the following printout:

Predictor Coef SE Coef T Prob
Constant 45.218 9.843 4.59 0.000
Experience 2.856 0.427 ? 0.000

R-Sq=88.2% R-Sq(adj)=87.5%

Assume that all conditions for regression are met.

Part a. What is the regression equation?

The regression equation uses the Constant as the intercept and the Experience coefficient as the slope.

(spoiler)

y^​=45.218+2.856x

Where y^​ is the predicted annual salary (in thousands of dollars) and x is the number of years of work experience.

Part b. What is a 95% confidence interval estimate for the slope of the regression line?

Recall the general formula for the confidence interval for the slope β:

b±t∗×SEb​

From the printout:

  • Sample slope: b=2.856
  • Standard error of the slope: SEb​=0.427
  • Sample size: n=18

Find the critical t-value t∗.

Degrees of freedom: df=n−2=18−2=16. For a 95% confidence level and df=16, the critical value is t∗≈2.12.

Calculate the margin of error and endpoints.

MELowerUpper​=t∗×SEb​=2.12×0.427≈0.906=2.856−0.906=1.95=2.856+0.906=3.76​

(spoiler)

The 95% confidence interval is (1.95,3.76).

Part c. Interpret the confidence level in context.

(spoiler)

If we were to take many random samples of employees and construct a 95% confidence interval from each sample for the true slope, we would expect 95% of those intervals to contain the true average change in annual salary (in thousands of dollars) associated with a one-year increase in work experience.

Part d. Does the confidence interval provide convincing evidence that annual salary is linearly related to years of work experience? Justify your answer.

The 95% confidence interval for the slope is (1.95,3.76).

(spoiler)

Yes. The interval does not include 0, which means β=0 is not a plausible value at the 5% significance level. So the interval provides convincing evidence that annual salary is linearly related to years of work experience.

Confidence Intervals for the Slope — Key Concepts

  • Sample slope b estimates true population slope β; varies sample to sample
  • SEb​ measures how much b is expected to vary across samples
  • df=n−2 for regression slope inference

Confidence Interval Formula

  • Formula: b±t∗×SEb​
  • t∗ found using df=n−2 and the chosen confidence level
  • Margin of error =t∗×SEb​

Interpreting the Slope

  • Slope = estimated change in y^​ for each one-unit increase in x
  • Always interpret in context of the specific variables

Interpreting the Confidence Interval

  • Interval gives plausible range of values for the true slope β
  • “We are [C%] confident the true slope β falls between [lower] and [upper]”
  • Confidence level interpretation: [C%] of intervals from repeated samples would contain the true β

Testing for Linear Relationship Using the Interval

  • If 0 is inside the interval → β=0 is plausible → no significant linear relationship
  • If 0 is outside the interval → significant evidence of a linear relationship
  • A fully positive or fully negative interval indicates a statistically significant slope

Reading Computer Regression Output

  • Coef column gives b (slope) and intercept
  • SE Coef column gives SEb​
  • Regression equation: y^​=Constant+Coef×x

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

Previous
Next  | 9.3 Hypothesis test for the slope of a least squares regression
All rights reserved ©2016 - 2026 Achievable, Inc.

Confidence intervals for a slope of a least squares regression

Confidence Intervals for the Slope of a Regression Line

When we fit a least squares regression line to sample data, the slope b we calculate is just an estimate of the true population slope β. Since the slope can vary from sample to sample, we use a confidence interval to estimate a plausible range of values for the true slope β.

Definitions

Least Squares Regression Line: A straight line y^​=a+bx that models the relationship between an explanatory variable x and a response variable y, chosen to minimize the sum of squared residuals.

Sample Slope (b): The slope of the regression line calculated from the sample data — used to estimate β.

Population Slope (β): The true slope of the linear relationship in the population.

Standard Error of the Slope (SEb​): A measure of how much the sample slope is expected to vary from sample to sample.

Confidence Interval for the Slope: A range of plausible values for the true population slope β, computed at a chosen confidence level.

Recall: What is the least squares regression line?

The least squares regression line is a straight line that models the relationship between a quantitative explanatory (independent) variable x and a quantitative response (dependent) variable y.

It’s chosen to minimize the sum of the squared vertical distances (residuals) between the observed data points and the line.

The equation of the least squares regression line is y^​=a+bx where:

  • y^​ is the predicted value of y for a given x.
  • a is the y-intercept.
  • b is the slope.

The slope tells you the estimated change in the response variable y for each one-unit increase in the explanatory variable x. For example, if a regression predicts a student’s final exam score (y) from hours studied (x) and the slope is 3, then each additional hour studied is associated with a predicted increase of 3 points in the exam score.

The slope b is computed from sample data, so it can vary from sample to sample. In inference, the goal is to learn about the true population slope, typically written as β. A confidence interval helps you estimate a plausible range of values for that true slope.

Key Equation: Confidence Interval for the Slope

b±t∗×SEb​

Where:

  • b — slope of the least squares regression line
  • SEb​ — standard error of the slope
  • n — sample size
  • df=n−2

Example 1

A statistics professor investigates the relationship between the number of hours students spent studying for a final exam and their exam scores. Data from a random sample of 15 students is collected. The least squares regression line calculated from the sample data is:

y^​=55.2+3.4x

Where y^​ is the predicted exam score and x is the number of hours studied. The standard error is SEb​=0.85. Assume that all the conditions for inference (linearity, constant variability, and normality) have been met.

Part a. Interpret the slope of the least squares regression line in the context of the problem.

The slope is the coefficient of x, which is 3.4.

(spoiler)

For each additional hour studied, the model predicts an average increase of 3.4 points in the exam score.

Part b. Calculate the 95% confidence interval for the true slope.

Recall the general formula for the confidence interval of the slope:

b±t∗×SEb​

From the problem:

  • b=3.4
  • SEb​=0.85
  • n=15

Find the critical t-value t∗.

Degrees of freedom: df=n−2=15−2=13. For a 95% confidence level and df=13, the critical value is t∗=2.160.

Calculate the margin of error and endpoints.

MELowerUpper​=t∗×SEb​=2.160×0.85=1.836=3.4−1.836=1.564=3.4+1.836=5.236​

(spoiler)

The 95% confidence interval is (1.564,5.236).

Part c. Interpret the interval in context.

(spoiler)

We are 95% confident that the interval from 1.564 to 5.236 contains the true population slope. In context, this suggests that for each additional hour studied, the true average exam score increases by between about 1.6 and 5.2 points.

Part d. Is there statistically significant evidence that there is a linear relationship between the study time and the exam score? Why or why not?

To check for evidence of a linear relationship, focus on whether β=0 (no linear relationship) is a plausible value for the slope. The 95% confidence interval from Part b is (1.564,5.236).

(spoiler)

Yes. Because the entire interval is above 0, β=0 is not plausible at the 5% significance level. This provides statistically significant evidence of a positive linear relationship between study time and exam scores.

Example 2

Information concerning the number of years of work experience and annual salary (in thousands of dollars) was collected from 18 randomly selected employees at a large company. A linear regression performed on the data using a statistical software package produced the following printout:

Predictor Coef SE Coef T Prob
Constant 45.218 9.843 4.59 0.000
Experience 2.856 0.427 ? 0.000

R-Sq=88.2% R-Sq(adj)=87.5%

Assume that all conditions for regression are met.

Part a. What is the regression equation?

The regression equation uses the Constant as the intercept and the Experience coefficient as the slope.

(spoiler)

y^​=45.218+2.856x

Where y^​ is the predicted annual salary (in thousands of dollars) and x is the number of years of work experience.

Part b. What is a 95% confidence interval estimate for the slope of the regression line?

Recall the general formula for the confidence interval for the slope β:

b±t∗×SEb​

From the printout:

  • Sample slope: b=2.856
  • Standard error of the slope: SEb​=0.427
  • Sample size: n=18

Find the critical t-value t∗.

Degrees of freedom: df=n−2=18−2=16. For a 95% confidence level and df=16, the critical value is t∗≈2.12.

Calculate the margin of error and endpoints.

MELowerUpper​=t∗×SEb​=2.12×0.427≈0.906=2.856−0.906=1.95=2.856+0.906=3.76​

(spoiler)

The 95% confidence interval is (1.95,3.76).

Part c. Interpret the confidence level in context.

(spoiler)

If we were to take many random samples of employees and construct a 95% confidence interval from each sample for the true slope, we would expect 95% of those intervals to contain the true average change in annual salary (in thousands of dollars) associated with a one-year increase in work experience.

Part d. Does the confidence interval provide convincing evidence that annual salary is linearly related to years of work experience? Justify your answer.

The 95% confidence interval for the slope is (1.95,3.76).

(spoiler)

Yes. The interval does not include 0, which means β=0 is not a plausible value at the 5% significance level. So the interval provides convincing evidence that annual salary is linearly related to years of work experience.

Key points

Confidence Intervals for the Slope — Key Concepts

  • Sample slope b estimates true population slope β; varies sample to sample
  • SEb​ measures how much b is expected to vary across samples
  • df=n−2 for regression slope inference

Confidence Interval Formula

  • Formula: b±t∗×SEb​
  • t∗ found using df=n−2 and the chosen confidence level
  • Margin of error =t∗×SEb​

Interpreting the Slope

  • Slope = estimated change in y^​ for each one-unit increase in x
  • Always interpret in context of the specific variables

Interpreting the Confidence Interval

  • Interval gives plausible range of values for the true slope β
  • “We are [C%] confident the true slope β falls between [lower] and [upper]”
  • Confidence level interpretation: [C%] of intervals from repeated samples would contain the true β

Testing for Linear Relationship Using the Interval

  • If 0 is inside the interval → β=0 is plausible → no significant linear relationship
  • If 0 is outside the interval → significant evidence of a linear relationship
  • A fully positive or fully negative interval indicates a statistically significant slope

Reading Computer Regression Output

  • Coef column gives b (slope) and intercept
  • SE Coef column gives SEb​
  • Regression equation: y^​=Constant+Coef×x

More from Linear regression

  • Slope and sampling distribution
  • Hypothesis test for the slope of a least squares regression