Field note · October 4, 2023

A weak correlation, and what it is not

A measured correlation of -0.36 between two columns, what its square says, and the diagnostic that costs one line.

1 min read ·Statistics ·statistics

pm10 and o3_ppb on city-air-quality move together — weakly, and negatively. r = -0.36 over 5,480 rows.

That is weak and negative. Squared, it says the linear relationship accounts for 12.8% of the variance in either column. That is the number worth quoting rather than r itself: -0.36 sounds like a much stronger claim than 12.8% does.

python
df[["pm10", "o3_ppb"]].corr(method="pearson")
# also worth running:
df[["pm10", "o3_ppb"]].corr(method="spearman")

Run Spearman next to Pearson every time. They agree when the relationship is roughly linear and diverge when it is monotone but curved — and the gap between them is a free diagnostic that costs one line.

A correlation this small is compatible with a real relationship that is not linear, with a real relationship confined to one segment, and with nothing at all. It does not distinguish between them, and neither does a bigger sample.

Look at the scatter before quoting r. Anscombe's quartet is four datasets with identical correlation coefficients and nothing else in common, and the correlation explorer will draw this pair so you can see which case you are in.

Longer treatment in Correlation, confounding, and Simpson's paradox.