Lesson 9.1 · Inference for Slopes
Confidence intervals for slope
In Unit 2 you fit a least-squares line to a set of data and interpreted its slope. But that slope came from one sample. A different random sample would give a different line and a different slope. In this lesson you'll build a confidence interval that estimates the slope of the true relationship in the whole population, using the same "statistic plus or minus margin of error" idea you used for proportions and means.
The population regression line
Imagine every individual in a population, not just the ones in your sample. For each value of , the responses have a distribution with some mean . If those means fall on a straight line, that line is the population regression line:
The slope (beta) and intercept (alpha) are parameters. You never know them exactly. Your sample gives the least-squares line , and its slope is a statistic that estimates .
Definition
Population slope and sample slope
The population slope is the change in the mean response for each one-unit increase in , for the whole population. The sample slope is the slope of the least-squares line computed from a sample. It is a point estimate of .
How much does the sample slope vary?
If you took many random samples of the same size and computed each time, the values of would form a sampling distribution. When the conditions below are met, that distribution is approximately Normal, centered at (so is an unbiased estimator), with standard deviation
where is the standard deviation of the responses around the population line. Since is unknown, you estimate it with , the standard deviation of the residuals. That gives the standard error of the slope:
You will almost never compute by hand. On the AP exam it is given in computer output, in the row for the explanatory variable, under a heading like "SE Coef."
The formula still tells you what makes a slope estimate precise. is smaller when the points hug the line (small ), when the values are spread out (large ), and when the sample is large (large ).
Conditions: LINER
Before using any inference procedure for slope, check five conditions. The acronym LINER helps you remember them.
Conditions for regression inference (LINER)
- Linear: The true relationship between and is linear. Check that the scatterplot looks linear and the residual plot shows no curved pattern.
- Independent: Individual observations are independent. When sampling without replacement, check the 10% condition: of the population.
- Normal: For any fixed , the responses vary Normally around the population line. Check that a dotplot, histogram or Normal probability plot of the residuals shows no strong skew or outliers.
- Equal SD: The standard deviation of is the same for every value of . Check that the residual plot has roughly equal vertical spread everywhere, with no "fan" or "funnel" shape.
- Random: The data come from a random sample or a randomized experiment.
Reading computer output
Here is the kind of output you'll see. A coffee cart owner takes a random sample of days and records the daily high temperature (, in °F) and the number of iced drinks sold ().
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | -26.0141 | 14.7730 | -1.76 | 0.116 |
| Temperature | 2.3313 | 0.1944 | 11.99 | 0.000 |
S = 5.2974, R-Sq = 94.7%
- The least-squares line is . The slope is in the Temperature row, Coef column.
- is in the same row, SE Coef column. Don't grab from the Constant row by mistake.
- is the standard deviation of the residuals: actual sales typically differ from the predicted sales by about drinks.
The confidence interval
t interval for the slope
Find from a distribution with degrees of freedom. You lose two degrees of freedom because the sample is used to estimate two things: the slope and the intercept.
Worked example: Building the interval
Use the coffee cart output to build a confidence interval for the slope of the population regression line.
With , , and .
The interval is about .
Worked example: Interpreting the interval
Interpret the interval from the previous example, and decide whether it gives convincing evidence of a linear relationship.
Interpretation: We are confident that the interval from to captures the slope of the population regression line relating daily high temperature to iced drinks sold. That is, for each °F increase in the daily high temperature, the mean number of iced drinks sold increases by somewhere between about and drinks.
Evidence: Every value in the interval is positive, and is not a plausible value for . So the data give convincing evidence of a positive linear relationship between temperature and iced drink sales.
Common mistake
Interpret the slope as a change in the mean (or predicted) response, not in each individual's response. "Each extra degree increases sales by 2 drinks" is wrong: on any given day, sales bounce around the line. Also, the interval is about the population slope . You already know exactly; there is no need to be "confident" about it.
Checking conditions with a residual plot
Here is the residual plot for the coffee cart data.
Worked example: Checking LINER
Check the conditions for the coffee cart interval. A dotplot of the residuals (not shown) is roughly symmetric with no outliers.
- Linear: The residual plot shows no leftover curved pattern; points are scattered above and below .
- Independent: days is less than of all days the cart operates.
- Normal: The dotplot of residuals shows no strong skew or outliers.
- Equal SD: The vertical spread of the residuals is about the same from left to right. There is no fan shape.
- Random: The days were a random sample.
All conditions are met, so the interval is appropriate.
Worked example: Working from output only
A random sample of used cars of one model gives mileage (thousands of miles) and price (thousands of dollars). The output shows and . Construct and interpret a confidence interval for . Assume the conditions are met.
, so .
The interval is about . We are confident that for each additional miles, the mean price of this model decreases by between about $52 and $119.
Tip
If you're given an interval and need to recover the pieces: the slope is the midpoint, and the margin of error is half the width. Dividing the margin of error by gives .
Practice
A researcher computes a confidence interval for the slope using a random sample of individuals. How many degrees of freedom should she use for ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
For a random sample of individuals, which critical value should be used for a confidence interval for the slope?
A random sample of homes in a city gives the output below, where is floor area (hundreds of square feet) and is price (thousands of dollars).
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 41.37 | 22.85 | 1.81 | 0.089 |
| Area | 8.62 | 1.35 | 6.39 | 0.000 |
S = 28.41, R-Sq = 71.8%
Assuming the conditions are met, find the lower endpoint of a confidence interval for the population slope. Round to the nearest hundredth.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A confidence interval for the slope relating a student's hours of weekly practice () to typing speed in words per minute () is . Which is the best interpretation?
A residual plot for a regression shows residuals close to for small values of and spreading out more and more as increases, in a fan shape. Which condition for inference is most clearly violated?
A confidence interval for a population slope is . What is the sample slope ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A confidence interval for a population slope, based on a random sample of individuals, is . Find the standard error of the slope, . Round to the nearest thousandth.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A scientist plans a study to estimate the slope relating fertilizer amount () to plant height (). Which change to her design would tend to produce a narrower confidence interval for the slope, keeping the confidence level the same?