Skip to contents

Aggregates a burden variable across combinations of grouping variables within a synthetic population.

Usage

make_summary_of_agents(
  dt,
  burden_col,
  group_by_cols,
  count_col = "Persons",
  mean_col = "Mean",
  total_col = "Total"
)

Arguments

dt

A data.table containing synthetic agents.

burden_col

Name of the burden variable.

group_by_cols

Character vector of grouping variables.

count_col

Name of the output count column. Defaults to "Persons".

mean_col

Name of the output mean column. Defaults to "Mean".

total_col

Name of the output total burden column. Defaults to "Total".

Value

A data.table containing grouped counts, mean burden and total burden.

Details

For each grouping combination, the function calculates:

  • Number of agents.

  • Mean burden.

  • Total burden.

This function is intended as a low-level utility used in burden and service-planning workflows.

Examples

if (FALSE) { # \dontrun{
summary_dt <- make_summary_of_agents(
  dt = agents_dt,
  burden_col = "DALYBurden",
  group_by_cols = c(
    "AgeGroup7",
    "SEXP"
  )
)
} # }