Prevent campaign data uses aggregates across years that a vaccine provides protection against a specific pathogen. Thus, we want to do some specific aggregation so that this analysis can be brought into the overall HEP calculations. This function does just that. For each pathogen, we take the data out to the latest year observed, or a separate year if provided. Then we do the rolling sums for them, and ensure that the rows make sense (filtering out for instance years before there were any pathogens reported for a country).
Usage
transform_prev_cmpgn_data(
df,
scenario_col,
value_col,
transform_value_col,
source,
ind_ids,
extrapolate_to
)
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.
- value_col
Column name of column with indicator values.
- transform_value_col
Column name of column(s) with transformed indicator values, used to calculate contributions.
- source
Source to use for prevent data that is flat extrapolated that has more than one unique value.
- 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()
.- extrapolate_to
Year to extrapolate Prevent data to, defaults to 2025
Details
These transform values are then flat extrapolated from their latest year out to a specific year, the default being 2023 If latest year values are provided for a specific pathogen, those years are used for calculating the rolling average out to, otherwise, the latest year with observed values is used.
See also
HEP functions
add_hep_populations()
,
calculate_hep_billion()
,
calculate_hep_components()
,
hep_df
,
transform_hep_data()
,
transform_prev_routine_data()
Other transform:
transform_prev_routine_data()