age_group_mapping: Calculate a mapping from one sets of age groups to another...

View source: R/demography.R

age_group_mappingR Documentation

Calculate a mapping from one sets of age groups to another set of age groups

Description

Sometimes data/results are stratified in different ways. For example in the UK data set vaccination is divided into age groups: <1, <5, <15, <25, <45, <65 and 65+, while virological data is provided as <5, <15, <45, <65 and 65+. This function calculates a mapping from one set of age groups to another. If the age groups we want to map to is a subset of the original age groups (as in the UK) then this is straightforward. If instead one or more of the from age group needs to be split over multiple to age groups then the function weights the age group by the size of the population (demography).

Usage

age_group_mapping(from, to, demography)

Arguments

from

The upper limit to each age groups you want to map from

to

The upper limit to each age groups you want to map to

demography

Optional vector with the demography of the population. This value is needed if the to age groups are not a subset of the from age groups. First value is the population of 0 year olds. Second of 1 year olds etc...

Value

A data frame containing which age groups map to which other age group. And what proportion (weight) of the age groups maps to the other age grouping.


MJomaba/flu-evidence-synthesis documentation built on April 26, 2022, 11:12 p.m.