Courses / Mathematics I
Data Analysis and Probability

Correlation and Regression

Mathematics I 346 words Free to read

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 rr, which always lies in [1,1][-1, 1]:

Correlation only detects linear association; a perfect parabola can have r=0r = 0 despite a clear relationship.

Linear regression goes further: it fits the line of best fit y^=mx+b\hat{y} = mx + b 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 yy from xx and interpret the slope as "the average change in yy per unit change in xx." Regression and correlation are linked: rr 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 rr 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 rr 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.

1r1,y^=mx+b-1 \le r \le 1,\quad \hat{y} = mx + b

Correlation and Regression

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

13practice questions
2interactive scenes
Start Mathematics I free

Data Analysis and Probability