aggregate_summarize_excess: Aggregate and summarize excess mortality estimates

Description Usage Arguments Value

Description

Given draws of baseline death COUNTS (not rates) and observed death counts, calculate summary metrics of excess mortality, optionally grouping by fields in the data

Usage

1
2
3
4
5
6
7
8
aggregate_summarize_excess(
  baseline_deaths_dt,
  aggregate = FALSE,
  group_cols = NULL,
  baseline_draw_cols = paste0("draw", 1:1000),
  obs_death_col = "deaths",
  alpha = 0.05
)

Arguments

baseline_deaths_dt

data.table containing draws of baseline death COUNTS (not rates), observed death counts, and optional identifier columns for the period when excess mortality is being calculated

aggregate

[bool, default FALSE] should the data be aggregated across grouping columns?

group_cols

[char, default NULL] If 'aggregate' is TRUE, group by these columns when aggregating baseline and observed deaths. If aggregation is specified and this argument is left as NULL, the aggregation will occur across all rows

baseline_draw_cols

[character, default c('draw1', ... 'draw1000')] columns in 'baseline_deaths_dt' that contain the draws for predicted baseline death counts

obs_death_col

[character, default 'deaths'] name of the column in 'baseline_deaths_dt' containing observed deaths by week

alpha

[numeric, default 0.05] Cutoff for two-tailed uncertainty interval. For example, the default of 0.05 will use the 95 interval for each outcome

Value

data.table containing at least the following fields: - Any grouping columns, if specified - 'obs_death_col' as specified in the function argument - 'bl_<mean/lower/upper>': Mean and UI bounds for baseline death counts - 'smr_<mean/lower/upper>': Mean and UI bounds for Standardized Mortality Ratios, calculated as observed / baseline - 'ex_d_<mean/lower/upper>': Mean and UI bounds for Excess Deaths, calculated as observed - baseline - 'sig_under1': Did the observed deaths fall BELOW the baseline deaths UI? - 'sig_over1': Did the observed deaths fall ABOVE the baseline deaths UI?


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.