Skip to content

Code for analysis and results generated in the paper "COVID-19 and the Drug Overdose Crisis: Uncovering the Deadliest Months in the United States, January-July 2020" Published in AJPH 2021

Notifications You must be signed in to change notification settings

akre96/cdc_overdose

Repository files navigation

Code for "COVID-19 and the Drug Overdose Crisis: Uncovering the Deadliest Months in the United States, January-July 2020"

Paper:

Friedman, J. & Akre, S. COVID-19 and the Drug Overdose Crisis: Uncovering the Deadliest Months in the United States, January‒July 2020. Am J Public Health e1–e8 (2021). doi:10.2105/ajph.2021.306256

Updated 07-17-2021

  • Overdose data by state for analysis purposes in: Useable_Overdose_Data_Through_Oct_2020.csv

Monthly Overdose Deaths: United States

Overdose Deaths

Monthly Overdose Deaths: Select U.S. States

Overdose Deaths - state level

Directory Layout

  • src/: Contains python scripts used in analysis
    • defilter_data.py: Disaggregates rolling sum data
    • estimate_error.py: Calculates error in disaggregation process from historical data
    • load_data.py: Cleans and preprocesses input datasets
    • tests/: Unit tests to ensure desired functions work as intended
  • input/: Input datafiles used for analysis
  • output/: Generated intermediate files
  • visuals/: Generated figures and tables
    • state_timeseries_2021-05-16.pdf: State by state data
  • CDC_overdose_monthly_recovery.ipynb: Python notebook used to disaggregate CDC overdose death data and calculate errors in that process
  • CDC_monthly_imputation.R: Imputes missing data from monthly "ground truth" overdose data
  • CDC_monthly_recovery_analysis.R: Run analysis and visualizations of monthly overdose data. Used to generate figures in manuscript.
  • Useable_Overdose_Data_Through_Sep_2020.csv: Cleaned monthly overdose death data by state. Intended for use by others.

Programming Environment

Python 3.7.6

  • pandas==1.2.0
  • numpy==1.19.4
  • scipy==1.5.4
  • matplotlib==3.3.3
  • seaborn==0.11.1
  • jupyterlab==3.0.0 .

R 4.0.3

Steps For Analysis

  1. Set up R and python environments
  2. Create an empty folder output and visuals inside of repository
    • Intermediate files and manuscript figures will be placed here
  3. Run CDC_monthly_imputation.R
    • Make sure to change root variable to point to location of this repository on your local system
  4. Run the full CDC_overdose_monthly_recovery.ipynb python notebook
  5. Run CDC_monthly_recovery_analysis.R
    • Make sure to change root variable to point to location of this repository on your local system

About

Code for analysis and results generated in the paper "COVID-19 and the Drug Overdose Crisis: Uncovering the Deadliest Months in the United States, January-July 2020" Published in AJPH 2021

Topics

Resources

Stars

Watchers

Forks