An R package for estimating excess mortality, using seasonal ARIMA models.
To install the package, use install_github() from the remotes package or pkg_install() from the pak package:
pak::pkg_install('yea-hung/estimateexcess')Load the package:
library(estimateexcess)Import your data:
weekly_data<-readRDS('weekly data.rds')To estimate excess mortality for the variable Inland Empire:
rr<-estimate_weekly_excess('Inland Empire',weekly_data)To view the plot:
rr$plotA possible framework for analyzing multiple variables is as follows:
r1<-estimate_weekly_excess('Los Angeles County',weekly_data)
r2<-estimate_weekly_excess('San Francisco Bay Area',weekly_data)
r3<-estimate_weekly_excess('Inland Empire',weekly_data)
results<-rbind(r1$results,r2$results,r3$results)This stacks all of the results from each analysis into a single data frame, named results.