Relationships Between Variables
When two numerical variables are measured together, we want to know how they relate. Two tools answer this.
Correlation measures the strength and direction of a linear relationship with a single number, the correlation coefficient , which always lies in :
- near — strong positive linear relationship (both rise together).
- near — strong negative linear relationship (one rises as the other falls).
- near — no linear relationship (though a nonlinear one may still exist).
Correlation only detects linear association; a perfect parabola can have despite a clear relationship.
Linear regression goes further: it fits the line of best fit through the data, chosen by least squares — minimising the sum of squared vertical distances (residuals) from the points to the line. The line lets you predict from and interpret the slope as "the average change in per unit change in ." Regression and correlation are linked: measures how tightly the points cluster around that best-fit line.
The single most important caution in all of statistics: correlation does not imply causation. A strong means the variables move together, not that one causes the other. The association could run the other way, or arise from a confounding variable driving both (ice-cream sales and drownings correlate — both are driven by hot weather, not by each other). Establishing causation requires controlled experiments or careful causal reasoning, never correlation alone.
Common pitfall: concluding that because two variables are correlated, one causes the other. Correlation measures only that they move together; a confounding variable may drive both, or the causal direction may be reversed, or the link may be coincidence. "Correlation does not imply causation" — causal claims require experiments or explicit causal reasoning, not a high alone.
A scatter plot with the accent least-squares line minimising the vertical residual segments from each point, the tightness of clustering illustrating the correlation strength.