get_averted_df.Rd
This function calculates the number of averted cases for different interventions compared to a base scenario.
get_averted_df(base, interventions)
A data frame with the calculated averted cases and proportions, with recoded age groups and outcomes.
The function performs the following steps:
Joins the base and intervention data frames on s
, outcome
, and age_group
.
Calculates the total number of cases averted and the proportion of cases averted.
Recodes the age groups and outcomes to more descriptive labels.
Converts the recoded age groups and outcomes to factors with specific levels.
if (FALSE) { # \dontrun{
base <- data.frame(s = 1:5, outcome = rep("symptomatic", 5), age_group = 1:5, cases_total = c(100, 200, 150, 120, 130))
interventions <- data.frame(s = 1:5, outcome = rep("symptomatic", 5), age_group = 1:5, cases_total = c(90, 180, 140, 110, 120))
get_averted_df(base, interventions)
} # }