• Steven Ponce
  • About
  • Data Visualizations
  • Projects
  • Resume
  • Email

The Correlation I Almost Trusted

One line I almost put in a chart, and the check that stopped me

Behind the Viz
Lessons Learned
R Programming
A behind-the-scenes look at a TidyTuesday analysis of the Cappuccino Index, where a striking correlation led to a mathematical trap — and a better question.
Author

Steven Ponce

Published

September 10, 2026

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 dispersion

What 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

Figure 1: Scatter plot titled “Cheap coffee isn’t necessarily affordable coffee,” plotting mean hourly barista wage against mean cappuccino price across 87 countries on log-log axes, with dashed diagonal lines marking equal work-time cost at 30, 60, and 120 minutes. Pakistan (£1.87 cappuccino, 277 minutes of work) and India (£1.96, 172 minutes) sit far left with cheap coffee but extreme work-time burdens driven by very low wages. Switzerland and Denmark, both averaging £5.41 per cappuccino, require only 14 and 19 minutes respectively, reflecting high wages.

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 the Full Visualization

See the full visualization, code, and write-up: Cheap Coffee Isn’t Necessarily Affordable Coffee

Back to top

Citation

BibTeX citation:
@online{ponce2026,
  author = {Ponce, Steven},
  title = {The {Correlation} {I} {Almost} {Trusted}},
  date = {2026-09-10},
  url = {https://stevenponce.netlify.app/behind_the_viz/2026/btv_2026_36.html},
  langid = {en}
}
For attribution, please cite this work as:
Ponce, Steven. 2026. “The Correlation I Almost Trusted.” September 10. https://stevenponce.netlify.app/behind_the_viz/2026/btv_2026_36.html.

© 2024 Steven Ponce

Source Issues