cappuccino_index
← all posts

Why top-3 rankings mislead

1 min read dataanalysis

The easy way to analyse this is to sort places by minutes per cup and read off the top and bottom three. It makes a good thumbnail but a weak conclusion.

Sample size

In a crowdsourced dataset a few cities have thousands of entries, while many have fewer than twenty. The extremes of a ranking tend to come from the thin end, because small samples stray further from the true average.

// keep a city only when it has enough data
const ranked = cities
  .filter(c => c.entries >= 100)
  .sort((a, b) => a.minutes - b.minutes);

Capital cities

Capitals pull averages towards tourist pricing. Separating the capital from the rest of the country often changes a country's position more than any other adjustment.

Use medians

One airport café charging triple shifts a mean noticeably, while the median barely moves. Report the median and the interquartile range, and the outliers become a separate story.