Similarly to combine_strat_model_output this functions reduces the dimension of model output into just the demographic components.

combine_to_age_model(
  df,
  age_com = NULL,
  compartments = NULL,
  hold_out_var = NULL,
  total_pop = TRUE
)

Arguments

df

A dataframe of model output.

age_com

Integer indicating the number of age compartments.

compartments

A character vector of the disease model compartments to combine.

hold_out_var

A character vector specifying the variables to keep unchanged. Defaults to NULL

total_pop

A logical indicating whether to calculate the total population. Defaults to true.

Value

A dataframe which summarises the demographic process of a model.

See also

combine_strat_model_output

Examples

df <- data.frame(S1 = c(1,2), S2 = c(1, 3), E1 = c(4, 1), E2 = c(3, 4), time = c(1, 2)) combine_to_age_model(df, age_com = 2, hold_out_var = "time")
#> time age_group_1 age_group_2 N #> 1 1 5 4 9 #> 2 2 3 7 10