age_group_mapping | R Documentation |
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).
age_group_mapping(from, to, demography)
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... |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.