Field note · November 8, 2024
r = 0.00 between no2_ppb and o3_ppb
A measured correlation of 0.00 between two columns, what its square says, and the diagnostic that costs one line.
Measured on city-air-quality: the Pearson correlation between no2_ppb and o3_ppb over 5,480 rows is 0.00.
That is essentially none. Squared, it says the linear relationship accounts for 0.0% of the variance in either column. Which is to say: nothing you would build anything on.
df[["no2_ppb", "o3_ppb"]].corr(method="pearson")
# also worth running:
df[["no2_ppb", "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.