Description Usage Arguments Value
Given draws of baseline mortality, observed starting population, and observed deaths by week, calculate excess mortality across many sub-population groupings. Sub-populations are identified by unique sets of ID columns. This is a wrapper for 'calculate_excess_time_series()', which calculates excess-adjusted population, excess deaths, and SMRs for a single population subgroup.
1 2 3 4 5 6 7 8 | calculate_excess_time_series_by_group(
experiment_draw_dt,
baseline_draw_cols,
group_cols,
week_col = "week",
obs_death_col = "deaths",
pop_col = "pop"
)
|
experiment_draw_dt |
data.table containing the experimental data ONLY for the time period when excess mortality is to be calculated. Should contain all of the fields specificied by the other parameters. |
baseline_draw_cols |
[character] columns in 'experiment_draw_dt' that contain the draws for predicted baseline mortality rate. |
group_cols |
[character] columns in 'experiment_draw_dt' with unique grouping identifiers. There should be no NULLs in any of these columns. |
week_col |
[character] name of the column containing week ID |
obs_death_col |
[character] name of the column containing observed deaths by week |
pop_col |
[character] name of the column containing estimated population by week, not adjusted (yet) to account for excess mortality. |
Named list of three items: - 'baseline_deaths': Data.table of baseline death draws with identifiers - 'smrs': Data.table of SMR draws with identifiers - 'excess_deaths': Data.table of excess death draws with identifiers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.