aggregate_sample_age_group: Produce Population Weighted Aggregations for Age Groups

View source: R/aggregation.R

aggregate_sample_age_groupR Documentation

Produce Population Weighted Aggregations for Age Groups

Description

Aggregate specified numeric columns by population-weighted age groups (rather than single year ages), split by specified categories.

Usage

aggregate_sample_age_group(
  results_list,
  aggr_cols = c("area_id", "area_name", "year", "model", "type"),
  num_cols,
  age_groups = c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39",
    "40-44", "45-49", "50-54", "54-59", "0+", "10+", "15+", "0-14", "10-24", "15-24",
    "10-29", "15-29", "10-39", "15-39", "10-49", "15-49", "30-49")
)

Arguments

results_list

list of data.frames outputted by combine_areas with join = FALSE, including area populations, with un-aggregated samples.

aggr_cols

Columns to aggregate samples by, Default: c("area_id", "area_name", "year", "model", "type")

num_cols

numeric columns to aggregate.

age_groups

Age groups to aggregate by, Default: c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39", "40-44", "45-49", "50-54", "54-59", "0+", "10+", "15+", "15-24", "10-24", 15-29", "10-29", "15-39", "10-39", "15-49", "10-49")

Value

data.frame with samples aggregated by aggr_cols and weighted by population.

See Also

combine_areas


mrc-ide/threemc documentation built on Feb. 9, 2024, 5:16 p.m.