Regression and correlation practice problems

By Jude Wallis · Published

These eight problems cover the core regression skills: finding the slope and intercept from summary statistics or raw data, interpreting the slope, r, and r-squared in context, and computing and reading residuals. Work each one first, then open the solution to check every step.

AP Statistics: Unit 5 (topics 5.2 Correlation, 5.3 Linear Regression Models, 5.4 Residuals, 5.5 Least-Squares Regression). This set spans Unit 5 of the Fall 2026 AP Statistics course: correlation (5.2), linear regression models (5.3), residuals (5.4), and least-squares regression (5.5). The redesigned course expects you to find coefficients with technology and interpret them in context, and it no longer includes inference for regression slopes.

What these problems build

These eight problems build the three regression skills Unit 5 tests together, using small clean numbers so you can focus on the method.

  • Find the line. Compute the slope bb and intercept aa from the means xˉ\bar{x} and yˉ\bar{y} (the mean of the x-values and of the y-values), the standard deviations sxs_x and sys_y, and the correlation rr, with b=rsysxb = r \cdot \frac{s_y}{s_x} and a=yˉbxˉa = \bar{y} - b\bar{x}, or straight from paired data.
  • Interpret in context. State the slope, the correlation rr, and the coefficient of determination r2r^2 in words, saying predicted and watching for extrapolation.
  • Work with residuals. Compute a residual as observed minus predicted, yy^y - \hat{y} (with y^\hat{y} read "y-hat"), and read what its sign says about the model.

For the method laid out step by step, read least-squares regression line, and check any line you build with the regression calculator. Try each problem before opening its solution, and keep extra decimals in sxs_x, sys_y, and rr until the final step. For more sets like this one, see all practice problems.

Problem 1

A greenhouse trial links the weekly fertilizer dose (in grams) given to each tomato plant, xx, to the season's yield (in kilograms), yy. Across the plants the summary statistics are xˉ=10\bar{x} = 10 grams, yˉ=50\bar{y} = 50 kg, sx=2s_x = 2 grams, sy=8s_y = 8 kg, and correlation r=0.75r = 0.75. Find the least-squares regression line y^=a+bx\hat{y} = a + bx and interpret the slope in context.

Show the worked solution
  1. Recall the two formulas. The slope is b=rsysxb = r \cdot \frac{s_y}{s_x}, where sxs_x and sys_y are the standard deviations (typical spread) of x and y and rr is the correlation. The intercept is a=yˉbxˉa = \bar{y} - b\bar{x}, where xˉ\bar{x} ("x-bar") and yˉ\bar{y} ("y-bar") are the means of x and y.

  2. Compute the slope. b=rsysx=0.7582=0.754=3b = r \cdot \frac{s_y}{s_x} = 0.75 \cdot \frac{8}{2} = 0.75 \cdot 4 = 3 kg per gram.

  3. Compute the intercept using the slope from the previous step. a=yˉbxˉ=50310=5030=20a = \bar{y} - b\bar{x} = 50 - 3 \cdot 10 = 50 - 30 = 20 kg.

  4. Write the line. y^=20+3x\hat{y} = 20 + 3x.

  5. Interpret the slope in context. The slope is 33 kg per gram, so for each additional gram of weekly fertilizer, the model predicts the yield increases by 3 kg.

  6. Check that the line passes through (xˉ,yˉ)=(10,50)(\bar{x}, \bar{y}) = (10, 50). At x=10x = 10, y^=20+310=50\hat{y} = 20 + 3 \cdot 10 = 50, which matches yˉ\bar{y}.

The least-squares line is y^=20+3x\hat{y} = 20 + 3x; each additional gram of weekly fertilizer predicts a 3 kg increase in yield.

Problem 2

A university makerspace logs, for four one-hour blocks, the number of 3D printers running, xx, and the electricity used that hour in kilowatt-hours, yy: (2,5)(2, 5), (4,9)(4, 9), (6,11)(6, 11), (8,15)(8, 15). Find the least-squares regression line y^=a+bx\hat{y} = a + bx from the data.

Show the worked solution
  1. Find the means. xˉ=2+4+6+84=204=5\bar{x} = \frac{2 + 4 + 6 + 8}{4} = \frac{20}{4} = 5 printers and yˉ=5+9+11+154=404=10\bar{y} = \frac{5 + 9 + 11 + 15}{4} = \frac{40}{4} = 10 kWh.

  2. Find the deviations from each mean. For xx: 25=32 - 5 = -3, 45=14 - 5 = -1, 65=16 - 5 = 1, 85=38 - 5 = 3. For yy: 510=55 - 10 = -5, 910=19 - 10 = -1, 1110=111 - 10 = 1, 1510=515 - 10 = 5.

  3. Sum the products of the paired deviations for the top of the slope. (xxˉ)(yyˉ)=(3)(5)+(1)(1)+(1)(1)+(3)(5)=15+1+1+15=32\sum (x - \bar{x})(y - \bar{y}) = (-3)(-5) + (-1)(-1) + (1)(1) + (3)(5) = 15 + 1 + 1 + 15 = 32.

  4. Sum the squared x-deviations for the bottom of the slope. (xxˉ)2=(3)2+(1)2+12+32=9+1+1+9=20\sum (x - \bar{x})^2 = (-3)^2 + (-1)^2 + 1^2 + 3^2 = 9 + 1 + 1 + 9 = 20.

  5. Compute the slope. b=(xxˉ)(yyˉ)(xxˉ)2=3220=1.6b = \frac{\sum (x - \bar{x})(y - \bar{y})}{\sum (x - \bar{x})^2} = \frac{32}{20} = 1.6 kWh per printer.

  6. Compute the intercept. a=yˉbxˉ=101.65=108=2a = \bar{y} - b\bar{x} = 10 - 1.6 \cdot 5 = 10 - 8 = 2 kWh.

  7. Write the line. y^=2+1.6x\hat{y} = 2 + 1.6x.

The least-squares line is y^=2+1.6x\hat{y} = 2 + 1.6x, so each extra printer running predicts 1.6 more kilowatt-hours that hour.

Problem 3

A candle maker fit a least-squares line predicting a candle's burn time (in hours) from its weight (in ounces): y^=2+1.5x\hat{y} = 2 + 1.5x, where xx is the weight and y^\hat{y} is the predicted burn time. (a) An 8-ounce candle actually burns for 15 hours. Find its residual and say what the sign means. (b) A 10-ounce candle has a residual of 2-2 hours. Find its observed burn time.

Show the worked solution
  1. Part (a): find the predicted burn time at x=8x = 8. y^=2+1.58=2+12=14\hat{y} = 2 + 1.5 \cdot 8 = 2 + 12 = 14 hours.

  2. Compute the residual, observed minus predicted. residual=yy^=1514=+1\text{residual} = y - \hat{y} = 15 - 14 = +1 hour.

  3. Read the sign. The residual is positive, so the observed value sits above the line and the model underpredicted this candle's burn time by 1 hour.

  4. Part (b): find the predicted burn time at x=10x = 10. y^=2+1.510=2+15=17\hat{y} = 2 + 1.5 \cdot 10 = 2 + 15 = 17 hours.

  5. Rearrange the residual formula to observed equals predicted plus residual. y=y^+residual=17+(2)=15y = \hat{y} + \text{residual} = 17 + (-2) = 15 hours.

  6. Read the sign. The negative residual means the model overpredicted: this 10-ounce candle burned 2 hours less than the line predicted.

(a) The residual is +1+1 hour, so the model underpredicted the burn time by 1 hour. (b) The observed burn time is 17+(2)=1517 + (-2) = 15 hours, and the negative residual means the model overpredicted.

Problem 4

A cycling shop fit a least-squares line predicting a used e-bike's resale price (in dollars) from its odometer reading (in hundreds of kilometers), xx: y^=150050x\hat{y} = 1500 - 50x. The e-bikes in the data had odometer readings from x=5x = 5 to x=40x = 40 (that is, 500 to 4000 km), and the correlation was r=0.9r = -0.9. Interpret the slope, the intercept, the correlation rr, and the coefficient of determination r2r^2 in context.

Show the worked solution
  1. Interpret the slope. Because xx is measured in hundreds of kilometers, the slope 50-50 means that for each additional 100 km on the odometer, the model predicts the resale price drops by 50 dollars.

  2. Interpret the intercept. The intercept 15001500 is the predicted price at x=0x = 0 (0 km). Since the data start at 500 km, x=0x = 0 is outside the observed range, so this is an extrapolation, not a value read directly from the data.

  3. Interpret the correlation. r=0.9r = -0.9 is close to 1-1, so there is a strong negative linear association: e-bikes with more kilometers tend to sell for less.

  4. Compute the coefficient of determination. r2=(0.9)2=0.81r^2 = (-0.9)^2 = 0.81.

  5. Interpret r2r^2. About 81 percent of the variation in resale price is explained by the linear relationship with odometer reading.

Slope: each extra 100 km predicts a 50 dollar drop. Intercept: 1500 dollars predicted at 0 km, an extrapolation. r=0.9r = -0.9 is a strong negative association, and r2=0.81r^2 = 0.81 means about 81 percent of the price variation is explained by odometer reading.

Problem 5

A call center studies its shifts. Across many shifts the number of agents on duty, xx, has mean xˉ=20\bar{x} = 20 and standard deviation sx=5s_x = 5, while the calls resolved per hour, yy, has mean yˉ=60\bar{y} = 60 and standard deviation sy=15s_y = 15; the correlation is r=0.8r = 0.8. (a) Find the least-squares regression line. (b) One shift had 25 agents and resolved 80 calls in an hour. Find that shift's residual and interpret it.

Show the worked solution
  1. Part (a): compute the slope. b=rsysx=0.8155=0.83=2.4b = r \cdot \frac{s_y}{s_x} = 0.8 \cdot \frac{15}{5} = 0.8 \cdot 3 = 2.4 calls per agent.

  2. Compute the intercept. a=yˉbxˉ=602.420=6048=12a = \bar{y} - b\bar{x} = 60 - 2.4 \cdot 20 = 60 - 48 = 12 calls.

  3. Write the line. y^=12+2.4x\hat{y} = 12 + 2.4x.

  4. Part (b): find the predicted number of calls at x=25x = 25. y^=12+2.425=12+60=72\hat{y} = 12 + 2.4 \cdot 25 = 12 + 60 = 72 calls.

  5. Compute the residual, observed minus predicted. residual=yy^=8072=+8\text{residual} = y - \hat{y} = 80 - 72 = +8 calls.

  6. Interpret the residual. It is positive, so the model underpredicted: this shift resolved 8 more calls than the line predicted for 25 agents.

(a) y^=12+2.4x\hat{y} = 12 + 2.4x. (b) The residual is +8+8 calls; with 25 agents the line predicted 72 calls, and the shift resolved 8 more than predicted.

Problem 6

An urban planner collects data on many neighborhoods and finds a correlation of r=0.7r = 0.7 between the number of coffee shops in a neighborhood, xx, and the average monthly apartment rent, yy. The data come from an observational study. (a) Interpret rr in context. (b) Compute and interpret the coefficient of determination r2r^2. (c) Does this show that adding coffee shops causes rents to rise? Explain.

Show the worked solution
  1. Part (a): interpret the correlation. r=0.7r = 0.7 is positive and moderately strong, so neighborhoods with more coffee shops tend to have higher average rent, and the association is roughly linear.

  2. Part (b): compute r2r^2. r2=(0.7)2=0.49r^2 = (0.7)^2 = 0.49.

  3. Interpret r2r^2. About 49 percent of the variation in average rent is explained by the linear relationship with the number of coffee shops; the other 51 percent is not.

  4. Part (c): weigh causation. The data are observational, not from an experiment, so a correlation on its own cannot establish cause.

  5. Name a lurking variable. Something like neighborhood population density or overall desirability could raise both the number of coffee shops and the rent, producing the association without one causing the other.

(a) r=0.7r = 0.7 is a moderately strong positive linear association. (b) r2=0.49r^2 = 0.49, so about 49 percent of the rent variation is explained by coffee-shop counts. (c) No; the study is observational, and a lurking variable such as neighborhood desirability could drive both.

Problem 7

A marine biologist measures sea turtles and summarizes shell length (in centimeters), xx, and body weight (in kilograms), yy: xˉ=40\bar{x} = 40 cm, sx=10s_x = 10 cm, yˉ=30\bar{y} = 30 kg, sy=20s_y = 20 kg, and r=0.8r = 0.8. The measured shells ranged from 30 to 55 cm. (a) Find the least-squares regression line. (b) Interpret the slope. (c) Interpret the intercept, and explain any problem with it. (d) Find r2r^2 and interpret it. (e) Predict the weight of a turtle with a 50 cm shell, and state whether that prediction is interpolation or extrapolation.

Show the worked solution
  1. Part (a): compute the slope, then the intercept. b=rsysx=0.82010=0.82=1.6b = r \cdot \frac{s_y}{s_x} = 0.8 \cdot \frac{20}{10} = 0.8 \cdot 2 = 1.6 kg per cm, and a=yˉbxˉ=301.640=3064=34a = \bar{y} - b\bar{x} = 30 - 1.6 \cdot 40 = 30 - 64 = -34 kg. The line is y^=34+1.6x\hat{y} = -34 + 1.6x.

  2. Part (b): interpret the slope. The slope 1.61.6 means that for each additional centimeter of shell length, the model predicts the weight increases by 1.6 kg.

  3. Part (c): interpret the intercept. The intercept 34-34 is the predicted weight at a shell length of 0 cm, which is a negative weight and therefore impossible. It also lies far outside the 30 to 55 cm range of the data, so it is an extrapolation with no logical meaning here.

  4. Part (d): compute r2r^2. r2=(0.8)2=0.64r^2 = (0.8)^2 = 0.64, so about 64 percent of the variation in turtle weight is explained by the linear relationship with shell length.

  5. Part (e): predict at x=50x = 50. y^=34+1.650=34+80=46\hat{y} = -34 + 1.6 \cdot 50 = -34 + 80 = 46 kg.

  6. Classify the prediction. Because 50 cm lies between the smallest and largest measured shells, 30 and 55 cm, this is interpolation, so the prediction is reasonably reliable.

(a) y^=34+1.6x\hat{y} = -34 + 1.6x. (b) Each extra cm of shell predicts 1.6 kg more weight. (c) The intercept 34-34 kg is a negative weight and an extrapolation, so it has no real meaning. (d) r2=0.64r^2 = 0.64, so 64 percent of the weight variation is explained. (e) y^=46\hat{y} = 46 kg, an interpolation since 50 cm is within 30 to 55 cm.

Problem 8

An ecologist runs a linear regression predicting a lake's dissolved oxygen (in mg/L), yy, from the water temperature (in degrees Celsius), xx. The output gives the line y^=140.25x\hat{y} = 14 - 0.25x with correlation r=0.95r = -0.95. (a) Interpret the slope. (b) At 20 degrees Celsius the measured dissolved oxygen was 8.5 mg/L; find and interpret the residual. (c) Find r2r^2 and interpret it. (d) The residual plot shows a clear U-shaped pattern. Given the high r2r^2, what does that say about using a line here?

Show the worked solution
  1. Part (a): interpret the slope. The slope 0.25-0.25 means that for each additional degree Celsius, the model predicts the dissolved oxygen falls by 0.25 mg/L.

  2. Part (b): find the predicted value at x=20x = 20. y^=140.2520=145=9\hat{y} = 14 - 0.25 \cdot 20 = 14 - 5 = 9 mg/L.

  3. Compute the residual, observed minus predicted. residual=yy^=8.59=0.5\text{residual} = y - \hat{y} = 8.5 - 9 = -0.5 mg/L.

  4. Interpret the residual. It is negative, so the observed value sits below the line and the model overpredicted the dissolved oxygen by 0.5 mg/L at 20 degrees.

  5. Part (c): compute r2r^2. r2=(0.95)2=0.9025r^2 = (-0.95)^2 = 0.9025, so about 90.3 percent of the variation in dissolved oxygen is explained by the linear relationship with temperature.

  6. Part (d): read the residual plot. A U-shaped pattern is curvature, which is the direct sign that a line is not the most appropriate model, even though r2r^2 is high. A large r2r^2 does not confirm linearity; only apparent randomness in the residual plot does, so the true relationship here bends and the line misses in a systematic pattern.

(a) Each extra degree predicts a 0.25 mg/L drop. (b) Predicted 9 mg/L, so the residual is 8.59=0.58.5 - 9 = -0.5 mg/L and the model overpredicted by 0.5. (c) r2=0.9025r^2 = 0.9025, about 90.3 percent of the variation explained. (d) The U-shaped residual plot shows curvature, so a line is not appropriate despite the high r2r^2.