Correlation & regression
Lines of best fit, residuals, and what r means.
Pen and paper is fine · no calculator needed why?
Opens at level 43.
the lesson
Read the lesson
The idea
A fitted line ŷ = a + bx turns an x into a prediction ŷ. The number a is the prediction when x is 0, and b, the slope, is how much the prediction changes for each extra unit of x. A residual is the miss: actual minus predicted.
The correlation r runs from −1 to 1. Its sign gives the direction, and its size says how tightly the points hug a straight line. r is not a percent, and a strong r alone never proves that one thing causes the other.
Techniques
Multiply, then add
- Multiply the slope by the x value first.
- Then add the starting value.
worked example
A fitted line says cost = 150 + 12.5 × units. What does it predict for cost when units = 8?
- 12.5 × 8 = 100.
- 150 + 100 = 250.
Answer: 250
Actual minus predicted
- Put x into the line to get the prediction.
- Residual: actual minus predicted.
- A negative residual means the line guessed too high.
worked example
A line predicts ŷ = 4 + 3x. At x = 6 the actual y is 19. What is the residual (actual minus predicted)?
- Predicted: 4 + 3 × 6 = 22.
- Residual: 19 − 22 = −3.
Answer: −3
Slope from r
- Multiply r by the standard deviation (SD) of y, the thing you predict.
- Divide by the SD of x.
- The slope has the same sign as r.
worked example
The correlation between x and y is −0.5. The standard deviation of y is 12 and of x is 8. What is the slope of the least-squares line for predicting y from x?
- −0.5 × 12 = −6.
- −6 ÷ 8 = −0.75.
Answer: −0.75
Tips by skill
- TipPredict from a line: Multiply the slope by x first, then add the starting value.
- TipResidual: Work out the predicted value, then take actual minus predicted. Keep the sign.
- TipRead a correlation: Sign gives direction. Size, ignoring the sign, gives strength: 0.9 strong, 0.6 moderate, 0.3 weak, 0.1 very weak. Never a percent, never proof of cause.
- TipSlope from r: Slope = r × SD of y ÷ SD of x. The SD of what you predict goes on top.
Watch out for
- Adding the starting value to the slope before multiplying by x.
- Subtracting the wrong way round. A point below the line has a negative residual.
- Reading r as a percent, or as proof of cause. It says how straight the pattern is and which way it runs.
- Flipping the ratio. The SD of the thing you predict goes on top.
skills · practice stats
-
Predict from a line not tried yet
worked example
A fitted line says score = 29 + 3.6 × hours. What does it predict for score when hours = 10?
Answer: 65
- 29 + 3.6 × 10 = 29 + 36 = 65.
-
Residual not tried yet
worked example
A line predicts ŷ = 17 + 5x. At x = 3 the actual y is 29. What is the residual (actual minus predicted)?
Answer: -3
- Predicted: 17 + 5 × 3 = 32.
- Residual = actual − predicted = 29 − 32 = −3.
-
Read a correlation not tried yet
worked example
Across weeks, the correlation between ad spending and website visits is 0.6. Which statement fits best?
- moderate negative linear relationship
- very weak positive linear relationship
- no relationship
- more ad spending causes 60% more visits
- moderate positive linear relationship
Answer: moderate positive linear relationship
- r = 0.6: the sign is positive (weeks with more ad spending tend to have more visits), and its size is in the middle: a clear but loose straight-line pattern.
- That’s a moderate positive linear relationship. Correlation alone doesn’t prove cause, and r is not a percent.
-
Slope from r not tried yet
worked example
The correlation between x and y is −0.6. The standard deviation of y is 18 and the standard deviation of x is 14. What is the slope of the least-squares line for predicting y from x? Round to 2 decimal places.
Answer: -0.77
- b = r × s_y ÷ s_x = −0.6 × 18 ÷ 14
- = −10.8 ÷ 14 ≈ −0.7714, which rounds to −0.77.
rest ladder
- 1 day
- 3 days
- 7 days
- 14 days
- 30 days
- 60 days
- mastered · every 90 days