Correlation and Regression
What the exam tests
Questions require the Karl Pearson correlation coefficient, Spearman's rank correlation, and the two regression lines with their coefficients. Interpretation of r and prediction from a regression equation are also examined.
Core rules
- Pearson: r = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)² Σ(y − ȳ)²]; equivalently r = Σxy/√(Σx²Σy²) using deviations.
- Rank correlation: ρ = 1 − 6Σd²/[n(n² − 1)], where d is the difference in ranks.
- Regression of y on x: y − ȳ = b_yx(x − x̄), with b_yx = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)².
- Regression of x on y: x − x̄ = b_xy(y − ȳ), with b_xy = Σ(x − x̄)(y − ȳ)/Σ(y − ȳ)².
- r = ±√(b_yx · b_xy); both regression lines pass through (x̄, ȳ).
Worked example
For x = 1, 2, 3 and y = 2, 4, 5: x̄ = 2, ȳ = 11/3 ≈ 3.667. Σ(x − x̄)(y − ȳ) = (−1)(−1.667) + 0(0.333) + 1(1.333) = 3. Σ(x − x̄)² = 2; Σ(y − ȳ)² ≈ 4.667. r = 3/√(2 × 4.667) = 3/3.055 ≈ 0.982, a strong positive correlation. b_yx = 3/2 = 1.5, so the line of y on x is y − 3.667 = 1.5(x − 2), i.e. y = 1.5x + 0.667. b_xy = 3/4.667 ≈ 0.643, and r² ≈ 0.964, consistent with r ≈ 0.982.
Traps
- Using the wrong denominator: b_yx divides by Σ(x − x̄)², not Σ(y − ȳ)².
- Assigning ranks in the wrong direction; rank correlation is unchanged if both rankings are reversed, but not if only one is.
- Failing to handle tied ranks with average ranks.
- Predicting outside the observed range of the data and treating the result as reliable.
- Forgetting that correlation does not imply causation.