Opioid deaths by race in United States, 2000-2015
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Opioid deaths by race in the United States — 2000-2015

PAA 2017 Main Figure


Code for a working paper and presentation given at PAA 2017, examining differences in opioid deaths by race/ethnicity and by poly-drug use.

Issues should be submitted via Github or email.


Our code requires the following R packages to reproduce paper and presentation plots:

  • tidyverse
  • RColorBrewer
  • scales
  • binom
  • grid

And for the exploratory plots:

  • ggforce
  • viridis

You can install these packages using the ./code/0_install_packages.R script, but it does not run automatically in order to avoid forcing updates on the user.

Note that presentation versions of the plots require the font "Arial Narrow" to be installed, and may not render as PDF properly unless the device is set to cairo_pdf.


To reproduce paper or presentation plots (including downloading the raw multiple cause of death data, raw population count data, raw standard population data, and the processing of all raw data), just set your working directory to this folder and run ./code/0_reproduce_everything.R.

The script will check to see if you already have downloaded and/or processed data and will not repeat those tasks if so. It will, however, overwrite existing plots.

Please note that even with a reasonably fast internet connection and processor, going from zero data to paper plots will take (at least) an hour or so.

Additionally, we re-created plots for the paper that include confidence intervals. These are commented out (since they are not in the actual paper), but can be generated by simmply uncommenting and running the code.

Lastly, an additional presentation was given at UMass Amherst. To reproduce those plots, just run ./reports/umass_presentation/0_generate_amherst_plots.R