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 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 .
The slope tells you the estimated change in the response variable for each one-unit increase in the explanatory variable . For example, if a regression predicts a student’s final exam score () from hours studied () and the slope is , then each additional hour studied is associated with a predicted increase of points in the exam score.
The slope 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.
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:
Where is the predicted exam score and is the number of hours studied. The standard error is . 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 , which is .
For each additional hour studied, the model predicts an average increase of points in the exam score.
Part b. Calculate the confidence interval for the true slope.
Recall the general formula for the confidence interval of the slope:
From the problem:
Find the critical t-value .
Degrees of freedom: . For a confidence level and , the critical value is .
Calculate the margin of error and endpoints.
The confidence interval is .
Part c. Interpret the interval in context.
We are confident that the interval from to contains the true population slope. In context, this suggests that for each additional hour studied, the true average exam score increases by between about and 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 (no linear relationship) is a plausible value for the slope. The confidence interval from Part b is .
Yes. Because the entire interval is above , is not plausible at the 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 |
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.
Where is the predicted annual salary (in thousands of dollars) and is the number of years of work experience.
Part b. What is a confidence interval estimate for the slope of the regression line?
Recall the general formula for the confidence interval for the slope :
From the printout:
- Sample slope:
- Standard error of the slope:
- Sample size:
Find the critical t-value .
Degrees of freedom: . For a confidence level and , the critical value is .
Calculate the margin of error and endpoints.
The confidence interval is .
Part c. Interpret the confidence level in context.
If we were to take many random samples of employees and construct a confidence interval from each sample for the true slope, we would expect 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 confidence interval for the slope is .
Yes. The interval does not include , which means is not a plausible value at the significance level. So the interval provides convincing evidence that annual salary is linearly related to years of work experience.