Skip to contents

Currently, the Prepare and DNR indicators are already calculated in the input data, so only Prevent is calculated in this function. It takes the numerator and denominator data from the inputs and calculates the vaccination coverage per year and country for each relevant pathogen, as well as the overall Prevent score. For DNR and its components, the level_col is calculated in this function.

Usage

calculate_hep_components(
  df,
  scenario_col = NULL,
  transform_value_col = "transform_value",
  source = sprintf("WHO DDI, %s", format(Sys.Date(), "%B %Y")),
  level_col = stringr::str_replace(transform_value_col, "transform_value", "level"),
  hepi_start_year = 2018,
  ind_ids = billion_ind_codes("hep", include_calculated = TRUE)
)

Arguments

df

Data frame in long format, where 1 row corresponds to a specific country, year, and indicator.

scenario_col

Column name of column with scenario identifiers. Useful for calculating contributions on data in long format rather than wide format.

transform_value_col

Column name of column(s) with transformed indicator values, used to calculate contributions.

source

Source to use if no unique source available for the calculation.

level_col

Column name(s) to create to hold levels data. Should be same length as transform_value_col.

hepi_start_year

First year to calculate HEP index for.

ind_ids

Named vector of indicator codes for input indicators to the Billion. Although separate indicator codes can be used than the standard, they must be supplied as a named vector where the names correspond to the output of billion_ind_codes().

Value

Data frame in long format.