TheEconomist / covid-19-excess-deaths-tracker

Source code and data for The Economist's covid-19 excess deaths tracker
https://www.economist.com/graphic-detail/coronavirus-excess-deaths-tracker
641 stars 163 forks source link

Error bars #12

Open lubo93 opened 4 years ago

lubo93 commented 4 years ago

Hi, thanks a lot for the great work you're doing. Would it be possible to add error bars in your .csv files? The CDC included an Upper Bound Threshold in their files and it would be quite helpful if you could do the same in your analysis.

The CDC error bars are based on 95% confidence intervals (see https://www.cdc.gov/nchs/nvss/vsrr/covid19/excess_deaths.htm). Using Gaussian error statistics, one can obtain Upper Bound Threshold via Upper Bound Threshold = Average Expected Count + 1.96*Standard Deviation.

Thanks!

lubo93 commented 4 years ago

Maybe one could just use mutate(expected_deaths = predict(expected_deaths_model,.,interval = "confidence") in the get_excess_deaths function. The default confidence interval is the 95% CI.

sondreus commented 3 years ago

Hi, sorry for the late reply. This is an interesting suggestion. Would happily have a look at a pull request with this suggested change. Thanks!