StatsQuest · Science Museum · Statistics
Correlation and Regression
Plot two quantitative variables first. Then r measures the linear strength and the least squares line predicts.
After this guide you can
- Describe a scatterplot by form, direction and strength.
- Interpret r and its cautions.
- Interpret the slope and intercept of ŷ = a + bx.
- Compute and read residuals and residual plots.
- Interpret r² and spot influential points.
Key terms
- Explanatory variable x
- The variable that may explain or predict; on the horizontal axis.
- Response variable y
- The outcome; on the vertical axis.
- Correlation r
- Strength and direction of a linear relationship, from −1 to 1.
- Least squares line
- The line that makes the sum of squared residuals as small as possible.
- Slope b
- b = r(s_y/s_x); predicted change in y for each 1 unit increase in x.
- Residual
- Observed − predicted: y − ŷ.
- r²
- The share of the variation in y explained by the linear model.
- Extrapolation
- Predicting outside the range of the x data; risky.
The big ideas
- r has no units and does not change if you switch x and y or change units.
- r measures only linear association; a strong curve can have r near 0.
- Correlation is not causation: lurking variables can drive both.
- The line always passes through (x̄, ȳ).
- A residual plot with no pattern supports a linear model; a curve or fan shape is a warning.
A residual is the vertical gap from a point to the line.
Worked example
Study hours x and scores y give ŷ = 52 + 4.5x with r = 0.8. Interpret, predict for 6 hours, and find the residual for a student at (6, 82).
- Slope: each extra hour predicts 4.5 more points on average.
- Intercept: 0 hours predicts 52 points (meaningful only if 0 hours is in the data range).
- ŷ = 52 + 4.5(6) = 79. Residual = 82 − 79 = +3, so this student scored 3 points above the line.
- r² = 0.64: 64% of the variation in scores is explained by hours.
Answer: Prediction 79; residual +3; r² = 0.64
Common mistakes
- Saying r = 0.8 means 80% of points are on the line.
- Computing residual as predicted − observed.
- Interpreting slope without units or "on average."
- Extrapolating far beyond the data.
- Concluding causation from a strong r.
Check yourself
- r = −0.9. Describe it.
- Can r be 1.3?
- ŷ = 10 + 2x. Predicted y at x = 7?
- Observed 20 at x = 7 with that line. Residual?
- r = 0.5. r²?
- Ice cream sales and drownings correlate. Why?
- A residual plot shows a U shape. What does that mean?
- One point far to the right changes the slope a lot. What is it called?
Answer key
- Strong negative linear association. Close to −1.
- No. r is always between −1 and 1.
- 24. 10 + 14.
- −4. 20 − 24.
- 0.25. 25% of variation explained.
- A lurking variable: hot weather. Correlation is not causation.
- A line is not the right form. The relationship is curved.
- An influential point. High leverage in x.
1 Design2 Describing3 Probability4 Normal5 CLT6 Intervals7 Tests9 Chi-square, ANOVA10 Health stats11 Full review