The Correlation I Almost Trusted
One line I almost put in a chart, and the check that stopped me
The Spark
This week’s TidyTuesday dataset asked a deceptively simple question: how long does a barista have to work to afford the cappuccino they just made? Across 87 countries, that question quickly turned into something more interesting: why does the index vary so much from one country to another?
The Detour
Early on, the data seemed to tell a clean story. The Cappuccino Index (minutes of work per cappuccino) correlated much more strongly with wages than with coffee prices:
- Index vs. wage: ρ = −0.927
- Index vs. coffee price: ρ = −0.353
I had a headline half-written in my head: it’s the wage, not the coffee.
Then I stopped, because it felt too convenient. The index isn’t an independent measurement – it’s defined as:
index = 60 × price / wage
Wage is sitting in the formula’s own denominator. So a strong negative association between wage and the index isn’t surprising – part of that relationship is built into the metric itself. The same problem applies, in the other direction, to price. Comparing those two correlations doesn’t cleanly tell me which ingredient is doing more of the work.
The Check
I needed a comparison that didn’t use the index itself. So I asked a simpler question: which ingredient varies more across countries?
driver_diag |>
summarise(
sd_log_price = sd(log(mean_price)),
sd_log_wage = sd(log(mean_wage))
)
# sd_log_price: 0.381
# sd_log_wage: 0.949 <- about 2.5× the price dispersionWhat survived was a narrower observation. On the log scale, wages show about 2.5× the cross-country dispersion of coffee prices – a much more defensible statement than “it’s the wage, not the coffee.”
The Chart
That detour changed the chart. Plotting wage against price directly makes both ingredients visible instead of hiding them inside a single ratio.
The Takeaway
When a metric is built from the variables you’re comparing it with, inspect the formula before interpreting the correlations.
A strong relationship may partly reflect the metric’s construction rather than a new empirical finding. Stepping away from the index and comparing the ingredients directly led to a narrower claim I could actually defend.
See how it was built
See the full visualization, code, and write-up: Cheap Coffee Isn’t Necessarily Affordable Coffee
Citation
@online{ponce2026,
author = {Ponce, Steven},
title = {The {Correlation} {I} {Almost} {Trusted}},
date = {2026-09-10},
url = {https://stevenponce.netlify.app/behind_the_viz/btv_2026_36.html},
langid = {en}
}