Skip to content

About

Seven ways numbers fool people. Short posts, real news cases, pandas notebooks and animated figures.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Data Make Sins

Seven ways numbers fool people. Each one is a short post, a real case from the news, a small dataset analysed with pandas, a figure, and an animated figure. Everything runs in a notebook you can download and run.

Open the animated web page · Start with the notebooks · Read the posts

Survivorship bias

The seven mistakes

# Mistake Real case Notebook Open in Colab
1 Survivorship bias The bombers that came back, 1943 01_survivorship_bias Colab
2 Mean instead of median US wealth: mean 551,000, median 108,000 02_mean_vs_median Colab
3 Relative risk without absolute risk Bacon and the 18 percent, WHO 2015 03_relative_vs_absolute_risk Colab
4 A chart axis that does not start at zero Fox tax chart 2012, Georgia chart 2020 04_truncated_axis Colab
5 Correlation is not causation Chocolate and Nobel prizes, 2012 05_correlation_vs_causation Colab
6 Base rate neglect The 99 percent accurate test, Cardiff 2017 06_base_rate_neglect Colab
7 Publication bias 74 antidepressant trials, 2008 07_publication_bias Colab

Every notebook is saved with its outputs, so you can read it on GitHub without running anything.

Preview

Mean slides away Ten more people
Axis slides down Chocolate and Nobel
One in eleven The file drawer

Run it

On your computer:

git clone https://github.com/CS42org/data-make-sins.git
cd data-make-sins
pip install -r requirements.txt
jupyter lab

Open notebooks/00_start_here.ipynb and follow the links.

On Google Colab: click a badge in the table. Run the first cell, it downloads the repo.

What is in the repo

notebooks/   one notebook per mistake, plus 00_start_here
data/        small CSV files used by the notebooks
figures/     every figure and GIF the notebooks produce
posts/       the seven posts as plain text, and the master list of 50 mistakes
docs/        the animated web page, published with GitHub Pages
src/dms.py   shared colours and plot style

The master list

The seven posts are the ones people fall for most often. The full list of 50 mistakes, grouped in six families, is in posts/data-mistakes-list.md.

Sources

Every real case links to the original reporting inside the post and the notebook. The main ones:

  • Levitt, Freakonomics, 2008: Good to Great companies after the book
  • UBS Global Wealth Report 2023: mean and median wealth per adult
  • The Guardian and Cancer Research UK, 26 Oct 2015: processed meat and bowel cancer
  • Fox Business, Cavuto, 31 Jul 2012, via FlowingData: the tax chart
  • Business Insider, May 2020: the Georgia chart with dates out of order
  • Messerli, New England Journal of Medicine, 10 Oct 2012, and Reuters: chocolate and Nobel prizes
  • BBC News, 4 May 2018: face recognition at the Champions League final
  • Turner et al, New England Journal of Medicine, 17 Jan 2008: selective publication of antidepressant trials
  • Cochrane and BMJ, 10 Apr 2014: the Tamiflu data

Inspired by How to Lie with Statistics (Huff), The Art of Thinking Clearly (Dobelli) and Thinking, Fast and Slow (Kahneman).

Note on the data

Two datasets are not real measurements. chocolate_nobel.csv holds values read from the published figure, so they are approximate. georgia_cases_illustrative.csv is invented to show the trick, not the real Georgia counts. Both are marked in the notebooks.

Licence

MIT. Use it in class, in a talk, in a blog. A link back is welcome.

About

Seven ways numbers fool people. Short posts, real news cases, pandas notebooks and animated figures.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages