From Correlation to Regression

Correlation measures direction and strength of co-movement
Positive
r = 0.98

Larger x tends to come with larger y.

Negative
r = -0.97

Larger x tends to come with smaller y.

Near zero
r = 0.09

No steady linear direction is visible.

Correlation and Linear Regression are often taught in the same breath, and they are closely related — the slope of a regression line is literally defined in terms of the correlation coefficient. But they answer different questions, and confusing them leads to real mistakes.

What correlation tells you

Correlation measures the strength and direction of a linear relationship between two variables. The coefficient rr runs from 1-1 to 11. A value of 0.80.8 tells you the variables move together strongly and positively. A value of 0.6-0.6 tells you they move in opposite directions, moderately.

What correlation doesn't tell you: how much yy changes when xx changes. It tells you the relationship is strong, not the rate.

Two datasets can have identical correlation but completely different slopes.

Same r, different slopes

Dataset A: xx ranges from 0 to 1, yy from 0 to 100. r=0.9r = 0.9.

Dataset B: xx ranges from 0 to 100, yy from 0 to 1. r=0.9r = 0.9.

The correlation is identical. But the slope in dataset A is roughly 100 (a 1-unit change in xx produces a 100-unit change in yy), while in dataset B it's roughly 0.01.

Correlation is dimensionless — it doesn't depend on the units of either variable. Slope is not.

What regression adds

Regression gives you the equation of the relationship — specifically, the line that best predicts yy from xx.

The slope of the least squares regression line is:

b=rsysxb = r \cdot \frac{s_y}{s_x}

This makes the connection explicit. The slope equals the correlation times the ratio of standard deviations. Correlation tells you the direction and relative strength; the standard deviations scale it into actual units.

If r=0.8r = 0.8, sy=20s_y = 20, and sx=4s_x = 4, then b=0.8×5=4b = 0.8 \times 5 = 4. A one-unit increase in xx is associated with a 4-unit increase in yy.

Regression is directional; correlation is not

The correlation of xx with yy is the same as the correlation of yy with xx. Regression is not symmetric.

The regression of yy on xx (predicting yy from xx) gives a different line than the regression of xx on yy (predicting xx from yy). Both pass through (xˉ,yˉ)(\bar{x}, \bar{y}), but they have different slopes unless r=1|r| = 1.

This asymmetry matters when you have a clear direction of prediction. If you're trying to predict a child's height from their age, you regress height on age — not the other way around.

The coefficient of determination

R2=r2R^2 = r^2 gives the proportion of variance in yy explained by the regression. If r=0.8r = 0.8, then R2=0.64R^2 = 0.64 — the regression explains 64% of the variation in yy.

The other 36% is variation that xx doesn't account for. It might be explained by other variables, by randomness, or by a non-linear relationship that the straight line misses.

Regression does not establish causation

Regression, like correlation, measures association. The slope tells you how much yy tends to change with xx in your data. It does not tell you that changing xx will cause yy to change.

Ice cream sales and drowning rates have a positive slope in a regression — more ice cream sales predicts more drownings. The confounding variable is summer. Regressing one on the other gives you a perfectly valid predictive model (given high ice cream sales, expect more drownings) without implying any causal mechanism.

To establish causation, you need either a randomised experiment or a careful causal argument about the data-generating process. Regression is a tool for description and prediction, not causation.

When to use which

Use correlation when you want to know: "do these variables tend to move together, and how strongly?"

Use regression when you want to: make predictions, understand the rate of change, or control for other variables (multiple regression).

Both are tools for describing linear relationships. Both are blind to non-linear patterns. Both can give misleading results if the relationship has a different shape — which is why plotting your data before fitting a line is not optional.

For the underlying mechanics, see Correlation and Linear Regression.