This repository contains code and data to accompany The Rules of Contagion: Why Things Spread - and Why They Stop by Adam Kucharski.
If you use any of the code/analysis under the GNU license, please cite 'Kucharski AJ, The Rules of Contagion: Why Things Spread - and Why They Stop, Wellcome Collection/Profile Books, 2020' as well as any relevant data sources (listed below).
The main script to reproduce the analysis is in scripts/main_plot_figures.R
. This script calls the following files:
R/plotting_functions.R
- Loads and plots data
R/functions_basic_sir.R
- Functions for SIR model
R/set_plot.R
- Customised plot settings
As you'd expect, data is the the data
folder and plots are output in the plots
folder.
- 1906 Bombay plague data: Epidemiological observations in Bombay City, Journal of Hygiene, 1907
- French Polynesia Zika GBS data: Cao-Lormeau et al, Lancet, 2016
- French Polynesia Zika case data: Kucharski et al, PLOS NTD, 2016
- House prices: Council of Mortgage Lenders
- VCR adoption: Consumer Electronics Association
-
South Sea Bubble data: Frehen et al, Journal of Financial Economics, 2013
-
1917 Typhoid data: Cumming, JAMA, 1917
- UK Pandemic data: Epidemiological report of pandemic (H1N1) 2009 in the UK
- Chicago gun violence data: Green et al, JAMA, 2017
- 1854 Cholera data: cholera R package
- Bangladesh diphtheria outbreak data: Finger et al, BMC Medicine, 2019
- 1976 Ebola data: Camacho et al, Epidemics, 2014
- Higgs retweet data: Stanford Network Analysis Project
- 'The Perfect Bet' YouTube data: Royal Institution (personal communication)