Elliott writes:

My boss asks me:

For our model to predict excess mortality around the world, we want to calculate a confidence interval around our mean estimate for total global excess deaths. We have real excess deaths for like 60 countries, and are predicting on another 130 or so. we can easily calculate intervals for any particular country. However, if we simulate each country independently, then the confidence interval surrounding the global total will be tiny, and incorrect, because you’ll never get simulations where like 160 countries are all off in the same direction. We need some way to estimate how errors are likely to be correlated between countries. What would Andrew Gelman recommend?

I [Elliott] shot back:

I’ll ask. He is going to recommend a hierarchical model, where you model excess deaths as a function of a global time trend, country-level intercept, country-level time trend and country-level covariates. Something like:

deaths ~ day + day^2 + (1 + day + day^2 | country) + observed_cases + observed_deaths + (observed_deaths | county)Oh, residual excess deaths are definitely are not a quadratic function, now that I think about it. Probably cubic or ^4. But you get the idea.

In brms, you could also do splines:

deaths ~ s(day) + s(day, by="country") + (1 | country) + ....Then, you take the 95% CI [actually, posterior interval, not confidence interval — AG] from the posterior draws.

Otherwise, you can derive the countey-by-country covariance matrix of day-level predicted excess deaths and simulate from a multivariate normal distribution (are excess deaths normally distributed? Maybe lognormal), then grab the CI off of that.

Yes, this all sounds vaguely reasonable. But definitely do the spline, not the polynomial. You should pretty much never be doing the polynomial.

I’d also recommend taking a look at the work of Leontine Alkema on Bayesian modeling of vital statistics time series.

Hi Elliott, where does your deaths/excess deaths data comes from?

In our World Mortality Dataset we have 89 countries and territories: https://github.com/akarlinsky/world_mortality.

Latest analysis here: https://github.com/dkobak/excess-mortality

And our preprint is here: https://doi.org/10.1101/2021.01.27.21250604

In our analysis of the data we collected, we do not suppose to forecast excess deaths as we have seen too many wild fluctuations across the world. We do however estimate excess in a given period by using a very simple yet efficient method which accounts both for seasonality and yearly trend.