Correlation and Regression
What the exam tests
Correlation measures the direction and strength of linear association; regression predicts one variable from another. Expect scatter diagrams, Karl Pearson's r, Spearman's rank correlation, regression coefficients and equations.
Core rules
- r = Σ(x − x̄)(y − ȳ)/√[Σ(x − x̄)²Σ(y − ȳ)²], equivalently [nΣxy − ΣxΣy]/√{[nΣx² − (Σx)²][nΣy² − (Σy)²]}.
- −1 ≤ r ≤ 1. r is unaffected by change of origin and scale, except that a negative scale factor changes its sign. r = 0 means no linear correlation, not necessarily independence.
- Spearman: R = 1 − 6Σd²/[n(n² − 1)], where d is the difference in ranks; use average ranks for ties.
- Regression of y on x: ŷ = a + bx, with b = rσy/σx = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)² and a = ȳ − bx̄.
- Regression of x on y: x̂ = c + dy, with d = rσx/σy.
- r² = b × d; the two regression lines intersect at (x̄, ȳ). If r = ±1, the lines coincide.
Worked example
Given x̄ = 10, ȳ = 20, σx = 2, σy = 3, r = 0.8: b = 0.8 × 3/2 = 1.2, so ŷ = 20 + 1.2(x − 10) = 1.2x + 8. Also d = 0.8 × 2/3 = 0.533, so x̂ = 10 + 0.533(y − 20). Check: b × d = 0.64 = r².
Traps
Using the y-on-x line to predict x; mixing σx and σy in the slope; assuming r = 0 proves no relationship; ranking the two variables in opposite directions; ignoring tied ranks in Spearman; treating a high r as proof of causation.