Lesson 33 of 1524
Linear regression and correlation
r measures a straight-line association. It does not, by itself, show cause.
Practice this chapterThe correlation r is a unitless number from −1 to 1. The sign is the direction. Values near −1 or 1 are strong linear associations. Values near 0 are weak.
The least-squares line predicts y from x. A residual is the observed y minus that prediction. r² is the fraction of the variation in y accounted for by the line. Using the line far outside the observed x-values is extrapolation.
Residual
residual = observed − predicted
Positive means the point sits above the line.
Worked example
A line predicts 8, and the observed value is 10. What is the residual?
- 1A residual is the observed y minus the y the line predicted. The order is observed first.
- 2Observed y is 10. Predicted y is 8.
- 310 − 8 = 2.
- 4The sign tells you which side of the line the point is on. Positive means the point is above the line. A prediction of 10 for an observed 8 would have given 8 − 10 = −2, below the line.
Result: 2
Why. The point’s actual y is 2 more than the line said it would be. That gap is the residual, and it is positive because the observation is above the prediction. Predicted minus observed would reverse the sign.
A correlation of −0.9 is a strong association. The minus sign is direction, not weakness. And neither a large r nor a fitted line proves that x causes y.
Practice margin
This chapter
A fresh set from this chapter only. Choose 10 or 20. Multiple choice and fill-in, with no repeat inside the set.