regression and correlation
Correlation Coefficient
You should know: linear regression
Overview
The Pearson correlation coefficient, r, measures the strength and direction of the linear relationship between two quantitative variables. It ranges from −1 to +1: r = +1 indicates a perfect positive linear relationship, r = −1 a perfect negative linear relationship, and r = 0 indicates no linear relationship (though a nonlinear relationship may still exist). The sign of r matches the sign of the slope of the best-fit regression line, and r² (the coefficient of determination) gives the proportion of variance in one variable explained by the other. Correlation measures association, not causation — a strong correlation between two variables does not imply that one causes the other.
Intuition
The correlation coefficient asks: when x is above its mean, is y also typically above its mean (positive correlation), typically below its mean (negative correlation), or is there no consistent pattern (near-zero correlation)? The numerator averages the products of paired deviations from their means — this product is positive when both variables move in the same direction relative to their means, and negative when they move in opposite directions. Dividing by the product of the standard deviations normalizes the result so that r is unitless and bounded between −1 and 1, regardless of the original variables' scales.
Formal Definition
For paired data (xᵢ, yᵢ), i = 1, ..., n, with sample means x̄ and ȳ:
Worked Examples
Compute means: x̄ = (1+2+3)/3 = 2, ȳ = (2+4+6)/3 = 4.
Compute deviations and products: (1-2)(2-4)=(-1)(-2)=2, (2-2)(4-4)=0, (3-2)(6-4)=(1)(2)=2. Sum = 4.
Compute sum of squared deviations: Σ(x-x̄)² = 1+0+1 = 2; Σ(y-ȳ)² = 4+0+4 = 8.
Answer: r = 1 (perfect positive linear relationship, since y = 2x exactly).
Practice Problems
If r = 0.9, what is the coefficient of determination, and what does it mean?
A scatterplot shows a strong negative linear trend. Which range best describes the correlation coefficient?
A study finds r = 0.85 between ice cream sales and drowning incidents across months. Does this mean ice cream sales cause drownings? Explain.
Quiz
Summary
- The Pearson correlation coefficient r measures the strength and direction of linear association between two variables, ranging from −1 to +1.
- r² (coefficient of determination) gives the proportion of variance in one variable explained by a linear relationship with the other.
- Correlation does not imply causation — a strong r can arise from confounding variables rather than a direct causal relationship.
Mathematics