Data and code from: Fentanyl purity and overdose decline: A reexamination of geographic trends
Data files
Aug 05, 2026 version files 2.54 MB
-
correlation.csv
3.53 KB
-
Negative_Control_Macroeconomic_Indicators-2.ipynb
648.50 KB
-
README.md
16.75 KB
-
spurious_correlation_analysis_data.csv
9.37 KB
-
US_national_fentanyl_ODs.csv
2.18 KB
-
Vangelov_recreation_in_Python.ipynb
1.86 MB
Aug 06, 2026 version files 2.54 MB
-
correlation.csv
3.53 KB
-
Negative_Control_Macroeconomic_Indicators-2.ipynb
648.50 KB
-
README.md
17.27 KB
-
spurious_correlation_analysis_data.csv
9.37 KB
-
US_national_fentanyl_ODs.csv
2.18 KB
-
Vangelov_recreation_in_Python.ipynb
1.86 MB
Abstract
Drug overdose deaths in the United States reached record levels during the fentanyl era before recently declining. A plausible hypothesis is that a sudden drop in fentanyl purity beginning in 2023 caused the downturn in overdose mortality. We evaluated this hypothesis by replicating a published analysis with regional overdose data, using models that account for time trends and autocorrelation, and negative control indicators to test for spurious correlation. When fentanyl purity was rising, the national purity series did not track overdose increases in most regions and showed only a modest association in the West. When both purity and mortality later declined, the observed associations were also seen with unrelated macroeconomic indicators that shared the same time pattern. National fentanyl purity alone does not provide a sufficient explanation for recent overdose declines.
Description of the data and file structure
Data and Code
Overview
This dataset accompanies a replication study of Vangelov et al. (Science, 2025), which proposed that a fentanyl purity "supply shock" starting in May 2023 was the primary driver of the decline in US drug overdose deaths. Our replication applies transfer function models with ARIMA-based prewhitening, stratified by US Census Region, to assess the robustness of the purity–mortality association. The dataset contains the merged input data and the analytic code required to reproduce all primary results.
Files
correlation.csv
The primary analytic dataset used for all transfer function models. Each row represents one region-month observation.
Rows: 108 (27 months × 4 US Census Regions)
Date range: July 2022 – September 2024
Variables:
| Variable | Type | Description |
|---|---|---|
| region | String | US Census Region: Northeast, Midwest, South, or West |
| date | Date (M/D/YY) | First day of the observation month |
| powder_purity_pct | Numeric | National fentanyl powder purity (%), extracted from the 2025 DEA National Drug Threat Assessment (page 23, red line, top panel). The same national series is repeated across all four regions, reflecting the common-input, differential-response design described in the manuscript. |
| mortality_rate_per_100k | Numeric | Monthly fentanyl overdose mortality rate per 100,000 population for the given Census Region. Derived from CDC WONDER / NVSS provisional data via the OD Pulse platform (Northwestern University). Overdose deaths defined by ICD-10 codes X40–X44, X60–X64, X85, or Y10–Y14, with T40.4 for synthetic opioids. |
Notes on the purity series: Values were obtained by manual coordinate extraction (pixel-level digitization) from a published DEA figure. Lin's concordance correlation coefficient between our extraction and the Vangelov et al. GitHub repository was 0.999; Bland–Altman mean difference was +0.164 percentage points (limits of agreement: −0.182 to +0.509). The purity series is not geographically stratified in the source data and is applied identically across regions as a direct test of the assumption in Vangelov et al. that a national measure is equally informative across the country.
Notes on the mortality series: Population denominators use Census Bureau intercensal estimates provided through OD Pulse. Provisional WONDER counts are subject to reporting lags but are considered nearly complete for the study period.
US_national_fentanyl_ODs.csv
National monthly fentanyl overdose mortality data from CDC WONDER, pre-processed by OD Pulse at Northwestern University. Each row represents one national month.
Rows: 100
Date range: August 2017 – November 2025
Variables:
| Variable | Type | Description |
|---|---|---|
| Date | String (YYYY Mon) | Observation month, formatted as year and abbreviated month |
| Deaths | Integer | National monthly fentanyl overdose death count |
| Rate | Numeric | National monthly fentanyl overdose mortality rate per 100,000 population |
Notes: This file provides a national overdose mortality time series for fentanyl-related deaths. It is derived from CDC WONDER mortality data as pre-processed by OD Pulse at Northwestern University. Values are reported nationally rather than by Census Region.
Vangelov_recreation_in_Python.ipynb
Jupyter notebook implementing the full transfer function modeling (TFM) pipeline. Reproduces all primary analytic results reported in the manuscript.
Sections:
- Configuration — File paths, region list, analytic block definitions (Block 1: July 2022–September 2023; Block 2: October 2023–September 2024), ARIMA order specification (1,1,0).
- Data loading — Reads correlation.csv, parses dates, validates structure.
- Descriptive statistics — Purity and mortality values at block boundaries by region (corresponds to manuscript Table 1).
- Prewhitening — Fits ARIMA(1,1,0) to the purity series for each region-block cell, extracts residual innovations, and applies the same filter to the mortality series.
- ARIMA diagnostics — Jarque–Bera normality tests, Ljung–Box serial correlation tests, ACF/PACF plots, QQ plots, and observed-versus-fitted plots for each region-block cell.
- Transfer function estimation — OLS regression of prewhitened mortality on prewhitened purity to estimate contemporaneous impulse-response weights (gain). Reports gain, standard error, p-value, R², and Ljung–Box residual diagnostics.
- Lag selection — BIC comparison of lag-0 versus lag-0,1 specifications.
- Geographic Concordance Index — Scales regional gains relative to the West (reference region).
- Heterogeneity analysis — Cochran's Q and I² statistics for between-region heterogeneity by block.
Outputs generated: output/tfm_results.csv (full model estimates by region-block) and output/tfm_heterogeneity.csv (Cochran's Q and I² by block).
Dependencies: Python 3.x with pandas, numpy, statsmodels, scipy, and matplotlib.
Usage:
pip install pandas numpy statsmodels scipy matplotlib
jupyter notebook Vangelov_recreation_in_Python.ipynb
The notebook expects correlation.csv in the working directory (configurable via the INPUT_FILE variable in the Configuration cell).
spurious_correlation_analysis_data.csv
Analytic dataset for the negative control (spurious correlation) analysis. Each row represents one national-level monthly observation.
Rows: 69
Date range: January 2019 – September 2024
Variables:
| Variable | Type | Description |
|---|---|---|
| date | Date (YYYY-MM-DD) | First day of the observation month |
| od_deaths | Integer | National monthly overdose death count (ICD-10 T40.x) from NCHS/CDC WONDER via OD Pulse |
| od_rate | Numeric | National monthly overdose mortality rate per 100,000 population from NCHS/CDC WONDER via OD Pulse |
| od_accel_decel | Numeric | Month-over-month change in overdose mortality rate (rate/month), derived |
| od_jerk | Numeric | Month-over-month change in acceleration (second difference of rate), derived |
| sentiment_index | Numeric | University of Michigan Consumer Sentiment Index (1966Q1 = 100) |
| cpi_12mo | Numeric | Consumer Price Index 12-month percentage change from BLS |
| pce_12mo | Numeric | Personal Consumption Expenditures 12-month percentage change from BEA |
| unemployment_u3 | Numeric | U-3 unemployment rate (%) from BLS |
| d_od_rate | Numeric | First difference of od_rate |
| d_sentiment | Numeric | First difference of sentiment_index |
| d_cpi | Numeric | First difference of cpi_12mo |
| d_pce | Numeric | First difference of pce_12mo |
| d_unemployment | Numeric | First difference of unemployment_u3 |
The first row of the following variables (denoted with prefix d_ for difference) are intentionally blank in spurious_correlation_analysis_data.csv because there is no preceding month-row from which to subtract to generate differences: d_od_rate, d_sentiment, d_cpi, d_pce, d_unemployment.
Negative_Control_Macroeconomic_Indicators-2.ipynb
Jupyter notebook implementing the negative control (spurious correlation) analysis reported in the manuscript supplement. Tests whether macroeconomic indicators with no pharmacological connection to overdose mortality can reproduce the same statistical association pattern observed between fentanyl purity and overdose deaths, providing evidence that the crude purity–mortality correlation rides on co-trending temporal structure rather than a causal pharmacological mechanism.
Sections:
- Setup — Imports and environment configuration.
- Load & Inspect Original Data — Reads three raw source files (OD Pulse mortality, BLS/BEA economic indicators, University of Michigan Consumer Sentiment).
- Parse, Merge & Trim — Harmonizes date formats, merges on month, and trims to the common January 2019 – September 2024 window.
- Visual Co-movement (Z-score Overlay) — Z-score normalization and overlay plot of overdose rate, CPI, and Consumer Sentiment.
- Unadjusted Pearson Correlation — Computes Pearson r and R² for level series to demonstrate the high correlations expected from co-trending non-stationary data.
- Unadjusted Cross-Correlation Function (CCF) — Lag-wise cross-correlations in levels, illustrating broad significance typical of spurious regression.
- Auto-ARIMA Model Selection (Box-Jenkins) — Fits auto-ARIMA (BIC-selected) to the overdose mortality rate series; reports selected order and ACF diagnostics for raw versus prewhitened residuals.
- Apply ARIMA Filter to Economic Indicators — Applies the same ARIMA filter to CPI and Consumer Sentiment series for prewhitening.
- Prewhitened Cross-Correlation Functions — CCFs on innovation residuals; demonstrates sign reversal and loss of significance after removing shared temporal trend structure.
- Composite Manuscript Figure — Three-row × two-column publication figure (Z-score overlay, unadjusted CCF, prewhitened CCF) for direct inclusion in Supplement S4.
- Results Summary & Interpretation — Summarizes the sign-reversal finding and its implications for the purity–mortality association.
- Export Analytical Dataset — Writes spurious_correlation_analysis_data.csv with all raw, differenced, and prewhitened variables.
Dependencies: Python 3.x with pandas, numpy, statsmodels, scipy, matplotlib, plotly, and pmdarima.
Usage:
pip install pandas numpy statsmodels scipy matplotlib plotly pmdarima
jupyter notebook Negative_Control_Macroeconomic_Indicators.ipynb
The notebook reads three input files (OD Pulse mortality, BLS/BEA indicators, Michigan Sentiment) and produces spurious_correlation_analysis_data.csv as its primary output.
Data sources
Fentanyl purity: DEA National Drug Threat Assessment
The fentanyl powder purity time series was extracted from the 2025 DEA National Drug Threat Assessment (page 23, red line, top panel) via a custom JavaScript-assisted manual coordinate extraction procedure to handle pixel-level anti-aliasing (described in Supplement S1 of the manuscript). The extracted series was validated against the Vangelov et al. GitHub repository: Lin's concordance correlation coefficient was 0.999 and Bland–Altman analysis showed a mean difference of +0.164 percentage points (limits of agreement: −0.182 to +0.509).
The DEA reports two types of purity quantification: routine law enforcement seizures analyzed at 10 DEA regional field labs, and intentionally selected samples sent to the DEA Fentanyl Profiling Program (FPP) at the Special Testing and Research Laboratory. The National Drug Threat Assessment figure from which these data were extracted likely includes both sources. Notably, in January 2023, the FPP shifted focus to seized samples weighing greater than 800 grams, and in July 2023 new sampling guidance directed the broader DEA laboratory system to prioritize submissions of fentanyl samples at or above 800 grams. This directive may have introduced a sampling artifact that inflated reported purity during 2023–2024. The series is reported only at the national level without geographic stratification of where samples were seized.
Overdose mortality: OD Pulse
Monthly drug overdose mortality counts were obtained from OD Pulse, an overdose surveillance data platform maintained by Northwestern University. OD Pulse preprocesses mortality data from the CDC Wide-ranging Online Data for Epidemiologic Research (WONDER) system and predicted-provisional overdose counts from the National Vital Statistics System (NVSS), using final multiple-cause-of-death files for completed calendar years and provisional data for more recent periods. Overdose deaths were defined using ICD-10 codes X40–X44, X60–X64, X85, or Y10–Y14, and coded with T40.4 (synthetic opioids, predominantly unregulated fentanyl and analogues). Monthly death counts were aggregated by the four US Census Regions and converted to population-adjusted mortality rates per 100,000 using Census Bureau intercensal population estimates provided through OD Pulse. The national fentanyl overdose mortality file, US_national_fentanyl_ODs.csv, was also obtained from CDC WONDER data pre-processed by OD Pulse. Provisional WONDER counts are subject to reporting lags but are considered nearly complete for the study period.
Macroeconomic indicators
Consumer Price Index (CPI) 12-month percentage change and U-3 unemployment rate were obtained from the Bureau of Labor Statistics (BLS). Personal Consumption Expenditures (PCE) 12-month percentage change was obtained from the Bureau of Economic Analysis (BEA). The University of Michigan Consumer Sentiment Index was obtained from the Surveys of Consumers, University of Michigan. All series are reported at the national level on a monthly basis.
Analytic blocks
The 27-month study period for the primary transfer function analysis is divided into two blocks at a structural break in the purity series:
- Block 1 (July 2022 – September 2023, n = 15 months): Period of rising fentanyl purity
- Block 2 (October 2023 – September 2024, n = 12 months): Period of declining fentanyl purity
The negative control analysis uses an extended window (January 2019 – September 2024, n = 69 months) to capture the full arc of the overdose mortality trend and its co-movement with macroeconomic indicators.
Correspondence
Nabarun Dasgupta, PhD
University of North Carolina at Chapel Hill
nab@unc.edu
Code/software
Python
Access information
Other publicly accessible locations of the data:
- OD Pulse at Northwestern University
Data was derived from the following sources:
- 2025 National Drug Threat Assessment
- CDC WONDER, pre-processed by OD Pulse at Northwestern University
- Bureau of Labor Statistics (CPI, unemployment)
- Bureau of Economic Analysis (PCE)
- University of Michigan Surveys of Consumers
Human subjects data
Fentanyl purity data are from drug samples, so not human subjects.
Overdose death rates represent human lives but contain no PII. They were pre-processed and made publicly available by OD Pulse from public CDC WONDER data. Therefore, data analyzed are at state/regional level and aggregated without demographics. These analyses did not rise to the level of IRB-reviewable human subjects research because they had been anonymized and made public by the national government of the United States.
