risk_group_mapping: Calculate a mapping from one sets of risk groups to another...

View source: R/demography.R

risk_group_mappingR Documentation

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

Description

Sometimes data/results are stratified in different ways. For example in the UK data set vaccination is divided into risk groups: low risk and high risk, while for the virological data is not stratified by risk. This function provides a standardised way of mapping one to another.

Usage

risk_group_mapping(from, to, weights)

Arguments

from

The risk groups you want to map from

to

The risk groups you want to map to

weights

Optional vector with the weight/fraction of how each from group should be grouped into a to group. For example if your epidemiological model groups everything together, but the data is divided into two equal risk groups you would use: risk_group_mapping(from = "All", to = c("R1", "R2"), weights = c(0.5, 0.5)). The UK example uses the mapping: risk_group_mapping(from = c("High risk", "Low risk", "Pregnant"), to = "All")

Value

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


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