
compute the least-squares regression line from summary statistics and with technology, and interpret its slope, intercept and r-squared in context.
Instruction
The data. The CDC’s National Center for Health Statistics publishes age-adjusted death rates by cause and state. For heart disease in Missouri, the rate fell from 300.5 deaths per 100,000 people in 1999 to 191.1 in 2017. (Age adjustment removes the effect of the population getting older, so rates from different years can be compared.) Let x = years since 1999 (0 to 18) and y = the rate.
What “least squares” means. For any line ŷ = a + bx, each point has a residual, y − ŷ: observed minus predicted. The least-squares regression line (LSRL) is the one line that makes the sum of the squared residuals as small as possible. Squaring keeps positive and negative misses from canceling and penalizes big misses heavily.
The formulas. Minimizing that sum (a calculus or algebra exercise, done in OpenStax Statistics chapter 12) gives:
b = r · sy / sx and a = ȳ − b x̄
The second formula says the line always passes through the point of means (x̄, ȳ). The first says: a change of one SD in x predicts a change of r SDs in y. Because |r| ≤ 1, predictions are pulled toward the mean. This is regression to the mean, the origin of the word.
Worked computation. For the 19 years: x̄ = 9, sx = 5.627; ȳ = 227.34, sy = 36.33; r = −0.9481.
b = −0.9481 × 36.33 / 5.627 ≈ −6.12 a = 227.34 − (−6.12)(9) ≈ 282.43
predicted rate = 282.43 − 6.12 × (years since 1999)
A spreadsheet (=SLOPE, =INTERCEPT, or a chart trendline) gives the same line.
Interpreting in context (A1.DS.A.6).
- Slope: from 1999 to 2017, Missouri’s age-adjusted heart-disease death rate fell by about 6.1 deaths per 100,000 per year, on average. Say “predicted” or “on average”, because not every year fell by 6.1.
- Intercept: the predicted rate for 1999 (x = 0) is 282.43 per 100,000. The actual 1999 rate was 300.5, so the line underestimates that year by 18.1. An intercept is meaningful only when x = 0 is inside or near the data, which is why we measured years from 1999 rather than from year 0.
- r2 = 0.899: about 89.9% of the variation in the yearly death rates is accounted for by the linear trend over time. The remaining 10.1% is variation the line does not capture.
Predicting. For 2010 (x = 11): 282.43 − 6.121(11) = 215.10, against an actual 201.8, a residual of −13.3. Predicting inside the range of the data is interpolation. Predicting outside it is extrapolation, and the next lesson shows why that is risky even with r2 = 0.899.
Two lines, not one. Regressing x on y gives a different line. The LSRL of y on x minimizes vertical distances only, so decide which variable is the response before you fit.
📖 Read for this lesson
The reading opens over the lesson; close it to come back to exactly where you were. The checks below draw on it.
Formative check
Work through these before moving on. They are not graded — they tell you whether the standard below has landed yet.
With r = −0.9481, s_y = 36.33 and s_x = 5.627, the slope is about ; with x̄ = 9 and ȳ = 227.34, the intercept is about .
Which is the best interpretation of the slope −6.12?
Simulation & tools
Find the least-squares line by hand, then check
Choose a dataset in the sim with a clear linear pattern. Turn on My Line and its Residuals and Squared Residuals.
- Drag your line until the total area of the squares is as small as you can make it. Record your slope, intercept and sum of squares.
- Turn on Best-Fit Line. Record its equation, r and sum of squares. How close did you get?
- Drag one point far above the line near the middle of the x-range, then near one end. Record how much the best-fit slope changes in each case.
Answer: why does the same outlier move the line more at the end of the x-range? No sim access: use a spreadsheet with the Missouri CDC table from this lesson’s reading, try three hand-chosen lines, compute the sum of squared residuals for each, then compare with =SLOPE and =INTERCEPT.
Open in a new tab ↗ · PhET Interactive Simulations, University of Colorado Boulder · CC BY 4.0
Enter the Missouri heart-disease rates from the table in this lesson’s reading (CDC/NCHS dataset bi63-dtpu, 1999-2017, retrieved 2026-11-10) into CODAP or a spreadsheet. Verify the line 282.43 − 6.12x. Then fit the same model to the cancer death rate (the Cancer column of the same table) and interpret its slope, intercept and r² in three sentences.
How confident are you that you can compute a least-squares line and interpret its slope, intercept and r² in context?
Practice
Work these on paper or in your notebook, then open Check your answer. Aim for all of Fluency and Application; try at least one Challenge.
Printable version: this unit’s practice workbook (PDF)
Fluency
Build speed and accuracy with the core skill.
- Use technology to find the least-squares line and the correlation coefficient for (1, 7), (2, 11), (7, 12), (11, 16), (12, 18), (13, 16), (14, 17).
Check your answer
Answer: ŷ = 7.818 + 0.705x; r = 0.942Interpret the slope in context: the predicted change in y for each one-unit increase in x. - Use technology to find the least-squares line and the correlation coefficient for (1, 6), (2, 10), (3, 12), (4, 12), (5, 12), (9, 21), (10, 23).
Check your answer
Answer: ŷ = 5.302 + 1.732x; r = 0.980Interpret the slope in context: the predicted change in y for each one-unit increase in x. - Use technology to find the least-squares line and the correlation coefficient for (1, 11), (3, 13), (6, 20), (7, 24), (9, 25), (12, 31), (14, 33).
Check your answer
Answer: ŷ = 9.216 + 1.779x; r = 0.989Interpret the slope in context: the predicted change in y for each one-unit increase in x. - Use technology to find the least-squares line and the correlation coefficient for (4, 22), (8, 32), (9, 39), (10, 40), (11, 44), (12, 44), (13, 51).
Check your answer
Answer: ŷ = 9.176 + 3.101x; r = 0.985Interpret the slope in context: the predicted change in y for each one-unit increase in x. - For Missouri’s age-adjusted cancer death rate, 1999-2017 (CDC), with x = years since 1999: r = −0.9897, s_x = 5.627, s_y = 13.376, x̄ = 9, ȳ = 189.484. Find the slope and intercept of the least-squares line.
Check your answer
Answer: b ≈ −2.353; a ≈ 210.66; predicted rate = 210.66 − 2.353x.b = r·s_y/s_x; a = ȳ − b·x̄. - Which point does every least-squares line pass through?
Check your answer
Answer: (x̄, ȳ), the point of means. - A line has r² = 0.64. What is r if the slope is negative?
Check your answer
Answer: r = −0.8.r has the sign of the slope.
Application
Use the skill in context. Show your reasoning.
- Interpret the slope (−2.353) and intercept (210.66) of the cancer model in context.
Check your answer
Answer: Slope: from 1999 to 2017 the model predicts Missouri’s age-adjusted cancer death rate fell by about 2.35 deaths per 100,000 per year, on average. Intercept: the predicted rate in 1999 (x = 0) is 210.66 per 100,000.Units of both variables, and ‘predicted’ or ‘on average’. - Use the cancer model to predict the 2010 rate and find the residual (the actual 2010 rate was 185.6).
Check your answer
Answer: Predicted ≈ 184.78; residual ≈ 0.82 per 100,000.x = 11; residual = actual − predicted. - Regressing Columbia’s annual precipitation on St. Louis’s (1973-2024) gives predicted COU = 9.897 + 0.766 × STL, with r = 0.777. Predict Columbia’s total in a year when St. Louis gets 50 inches, and interpret r².
Check your answer
Answer: Predicted ≈ 48.19 in. r² ≈ 0.604: about 60% of the year-to-year variation in Columbia’s totals is accounted for by the linear relationship with St. Louis’s.
Challenge
Stretch problems. Expect to think before you write.
- Regressing St. Louis on Columbia instead gives slope 0.789. Show that this is not 1/0.766, and explain why the two lines differ.
Check your answer
Answer: 1/0.766 ≈ 1.306, not 0.789. Each least-squares line minimizes vertical distances for its own response; both slopes equal r times a ratio of SDs, and since |r| < 1 neither is the reciprocal of the other.b(COU on STL) · b(STL on COU) = r² ≈ 0.604.
Review
Keep earlier skills sharp.
- (Unit 1) For the data 12, 15, 15, 18, 30, find Q1, Q3 and the upper 1.5 × IQR fence. Is 30 an outlier?
Check your answer
Answer: Q1 = 13.5, Q3 = 24, IQR = 10.5; upper fence 39.75, so 30 is not an outlier.Halves: 12, 15 and 18, 30. - (Unit 1) Which is more resistant to an outlier, the mean or the median?
Check your answer
Answer: The median.
Missouri Death Rates, 1999-2017: The CDC Table the Regression Runs On
CDC/NCHS, NCHS – Leading Causes of Death: United States (data.cdc.gov dataset bi63-dtpu), Missouri rows, age-adjusted death rates per 100,000, 1999-2017; retrieved November 10, 2026 · Public domain (works of the United States government)
Why this reading. The lab fits a line to Missouri’s heart-disease death rates and then asks you to import the CDC file and fit the same model to cancer. The rows are here, for heart disease and five other causes, with the summary statistics that b = r·sy/sx needs for each. The lesson’s line reproduces from this table to the last digit.
What the numbers are
The CDC’s National Center for Health Statistics publishes NCHS – Leading Causes of Death: United States on data.cdc.gov (dataset id bi63-dtpu), with one row per year, state and cause, 1999-2017. The rate is the age-adjusted death rate per 100,000 population, standardized to the 2000 U.S. standard population, so that a state whose population is getting older does not show a rising rate for that reason alone. The deaths column is the raw count; it is given here for heart disease only. Rows for Missouri retrieved November 10, 2026. x is years since 1999.
| Year | x | Heart disease rate | Heart disease deaths | Cancer | Stroke | Alzheimer’s | Unintentional injuries | Chronic lower respiratory |
|---|---|---|---|---|---|---|---|---|
| 1999 | 0 | 300.5 | 17,974 | 207.9 | 65.6 | 15.0 | 43.2 | 51.7 |
| 2000 | 1 | 286.0 | 17,235 | 205.9 | 65.1 | 17.8 | 41.9 | 46.9 |
| 2001 | 2 | 273.4 | 16,633 | 207.1 | 62.0 | 17.8 | 42.5 | 47.8 |
| 2002 | 3 | 272.7 | 16,708 | 204.1 | 63.1 | 19.0 | 45.6 | 47.2 |
| 2003 | 4 | 264.9 | 16,410 | 202.1 | 57.7 | 20.6 | 47.6 | 47.9 |
| 2004 | 5 | 248.5 | 15,500 | 201.1 | 56.1 | 21.9 | 46.4 | 44.1 |
| 2005 | 6 | 236.8 | 14,974 | 198.0 | 52.9 | 25.6 | 47.8 | 49.2 |
| 2006 | 7 | 228.8 | 14,749 | 195.8 | 50.5 | 25.1 | 50.1 | 47.4 |
| 2007 | 8 | 218.9 | 14,338 | 190.9 | 49.4 | 25.5 | 48.8 | 47.6 |
| 2008 | 9 | 219.8 | 14,644 | 189.5 | 49.2 | 30.0 | 48.9 | 57.4 |
| 2009 | 10 | 206.1 | 13,916 | 185.7 | 44.9 | 25.5 | 47.5 | 51.9 |
| 2010 | 11 | 201.8 | 13,840 | 185.6 | 44.0 | 28.8 | 47.9 | 52.6 |
| 2011 | 12 | 197.4 | 13,810 | 179.4 | 43.4 | 27.4 | 50.5 | 50.5 |
| 2012 | 13 | 193.4 | 13,742 | 182.3 | 42.2 | 25.9 | 47.8 | 51.7 |
| 2013 | 14 | 194.7 | 14,095 | 179.4 | 40.6 | 27.5 | 47.0 | 52.9 |
| 2014 | 15 | 194.7 | 14,338 | 177.7 | 41.0 | 27.4 | 48.7 | 51.4 |
| 2015 | 16 | 197.9 | 14,808 | 173.4 | 40.8 | 28.7 | 50.9 | 52.8 |
| 2016 | 17 | 192.1 | 14,579 | 167.0 | 40.4 | 30.0 | 57.0 | 52.1 |
| 2017 | 18 | 191.1 | 14,820 | 167.3 | 41.0 | 32.3 | 58.8 | 50.7 |
Summary statistics for the regression formulas
For every cause, x̄ = 9 and sx = 5.627 (the 19 values 0 to 18). The table gives ȳ, sy, r, and the line they produce.
| Cause | ȳ | sy | r | slope b | intercept a | r² |
|---|---|---|---|---|---|---|
| Heart disease | 227.34 | 36.33 | −0.9481 | −6.121 | 282.43 | 0.899 |
| Cancer | 189.48 | 13.38 | −0.9897 | −2.353 | 210.66 | 0.980 |
| Stroke | 49.99 | 9.09 | −0.9637 | −1.556 | 64.00 | 0.929 |
| Alzheimer’s disease | 24.83 | 4.82 | 0.9071 | 0.778 | 17.83 | 0.823 |
| Unintentional injuries | 48.36 | 4.19 | 0.8090 | 0.603 | 42.94 | 0.654 |
| CLRD | 50.20 | 3.06 | 0.5387 | 0.293 | 47.57 | 0.290 |
Heart disease, worked. b = −0.9481 × 36.33 / 5.627 = −6.121, and a = 227.34 − (−6.121)(9) = 282.43: the lesson’s 282.43 − 6.12x. Cancer, for you to verify. b = −0.9897 × 13.38 / 5.627 = −2.353 and a = 210.66, with r² = 0.980. The cancer rate fell more slowly than the heart-disease rate (about 2.4 per 100,000 per year against 6.1) but far more steadily: its largest residual is 3.7 (2016), against 18.8 for heart disease. Check that before you interpret r².
Rates and counts move differently. Heart-disease deaths fell from 17,974 in 1999 to 14,095 in 2013 and then rose to 14,820 in 2017, while the age-adjusted rate went from 194.7 to 191.1 over the same four years. A count depends on how many people there are and how old they are, and the age-adjusted rate is built to remove the second of those. A report must say which one it is modeling.
What to do
- Enter x and the heart-disease rate. Confirm =SLOPE, =INTERCEPT and =RSQ give −6.12, 282.43 and 0.899.
- Fit the cancer rate. Interpret the slope, the intercept and r² in three sentences with units, saying “predicted” or “on average”.
- Choose one more cause. Predict from the scatterplot whether a line will fit well, then compute r² and see whether you were right. Unintentional injuries is the honest test.
Sources: CDC/NCHS, NCHS – Leading Causes of Death: United States, dataset bi63-dtpu (data.cdc.gov); Query used for the Missouri rows (state=Missouri) (data.cdc.gov)