Can state economic and demographic data from 2014–2018 forecast overdose deaths in 2019–2022? Poisson GLMs and spline GAMs against a hierarchical Bayesian negative-binomial model, all fit in base R.
How well do state-level data from 2014–2018 forecast overdose deaths in 2019–2022, the years of the fentanyl surge? I compare five likelihood models (Poisson GLMs and spline GAMs with state fixed effects) with a hierarchical Bayesian negative-binomial model.
Every model is trained on 2014–2018 and scored on 2019–2022. The best forecaster is GLM 2, with state effects and the LASSO-selected covariates (RMSE 508 deaths, median absolute error 13% of a state's count). The Bayesian model with one shared national trend is close behind (RMSE 521) and has the best-calibrated intervals (77% of outcomes inside its 90% band). Giving every state its own pre-2019 trend makes forecasts worse (RMSE 959): five years are too few to extrapolate a state-specific slope four years ahead. No model reaches 90% coverage. Every one underpredicts 2020–2022, because nothing in these covariates anticipates fentanyl saturating the drug supply. State identity carries most of the signal; the economic covariates add little.
overdose_states.csv: 50 states (no DC) × 2014–2022. The fields are overdose deaths, the published age-adjusted rate per 100,000, population (thousands), GDP, per-capita income, homeownership, percent with a bachelor's degree, and state tax collections. The rates match CDC all-drug overdose death rates (for example West Virginia 2021 at 90.9), so the response is all overdose deaths, not fentanyl-only deaths.
| State | Year | Published rate | Deaths in file | Implied by rate | Deaths used |
|---|---|---|---|---|---|
| AR | 2014 | 18.20 | 1,211 | 540 | 356 |
| AZ | 2014 | 12.60 | 356 | 848 | 1,211 |
The crude rate over the published rate ranges 0.66–1.43 across all 450 rows (median 0.97). That is the expected gap between crude and age-adjusted rates.
Candidates are per-capita GDP, per-capita income, per-capita state tax revenue, homeownership, bachelor's degree share, and year. The response is log deaths per resident in the training years. Folds are whole states, so no state appears in both the fitting and scoring folds. The one-standard-error rule picks the sparsest model within one SE of the best.
| Variable | Coefficient at λ(1se) | Coefficient at λ(min) | Selected |
|---|---|---|---|
| GDP per capita | 0 | 0 | |
| Income per capita | 0 | 0.0198 | |
| Tax revenue per capita | 0 | 0 | |
| Homeownership % | 0 | -0.0235 | |
| Bachelor's degree % | 0.0206 | 0.0319 | yes |
| Year | 0.0414 | 0.0457 | yes |
The LASSO keeps bachelor’s % and year. A second set read off a causal diagram (GDP, bachelor’s %, year) is kept as a theory-driven alternative.
| Model | Structure | Family |
|---|---|---|
| GLM 1 · intercept only | log μ = log pop + α | quasi-Poisson |
| GLM 2 · state + LASSO set | log μ = log pop + α_state + LASSO covariates | quasi-Poisson |
| GLM 3 · state + DAG set | log μ = log pop + α_state + GDP + bachelor's + year | quasi-Poisson |
| GAM 1 · state + splines (LASSO) | as GLM 2 with natural cubic splines (3 df) | quasi-Poisson |
| GAM 2 · state + splines (DAG) | as GLM 3 with splines on GDP and bachelor's | quasi-Poisson |
| Bayes · NB, state trends | log μ = log pop + a_s + b_s·year + GDP + bachelor's; a_s and b_s partially pooled | negative binomial |
| Bayes · NB, common trend | log μ = log pop + a_s + β·year + GDP + bachelor's; a_s partially pooled | negative binomial |
The Bayesian models give every state its own level. The first also gives every state its own pre-2019 trend. Both are drawn toward the national average in proportion to how noisy the state's own data are. Covariates are centered within state, so their coefficients describe within-state change and do not compete with the state intercepts. Both are fit with a Metropolis-within-Gibbs sampler written for this project: two chains, 16,000 iterations, 4,000 burn-in, thinned by 6.
| Parameter | mean | q05 | q95 | Rhat | ESS |
|---|---|---|---|---|---|
| mu_b (mean yearly log-rate change) | 0.0759 | 0.0445 | 0.107 | 1.02 | 151 |
| sigma_b (between-state spread of trend) | 0.0649 | 0.0526 | 0.0793 | 1.00 | 2,122 |
| sigma_a (between-state spread of level) | 0.399 | 0.337 | 0.471 | 1.00 | 4,000 |
| beta: GDP per capita (per SD) | -0.104 | -0.215 | 0.00168 | 1.02 | 228 |
| beta: bachelor's degree % (per SD) | 0.0922 | -0.0828 | 0.262 | 1.01 | 174 |
| phi (NB size) | 148 | 117 | 183 | 1.00 | 1,990 |
| a[WV] (state level) | -7.73 | -7.80 | -7.67 | 1.00 | 2,771 |
| Model | RMSE | MAE | Median APE % | 90% PI coverage % |
|---|---|---|---|---|
| GLM 1 · intercept only | 1,128 | 740 | 38.5 | 65.5 |
| GLM 2 · state + LASSO set | 508 | 281 | 13.4 | 76 |
| GLM 3 · state + DAG set | 560 | 296 | 13.2 | 74.5 |
| GAM 1 · state + splines (LASSO) | 513 | 296 | 13.0 | 75 |
| GAM 2 · state + splines (DAG) | 624 | 353 | 16.5 | 74 |
| Bayes · NB, state trends | 959 | 498 | 18.3 | 64 |
| Bayes · NB, common trend | 521 | 289 | 13.3 | 77 |