Scenario return to previpus trajectory
Source:R/scenarios_return_previous_trajectory.R
scenario_return_previous_trajectory.Rd
This scenario returns to the scenario_previous_trajectory
after the last
value of scenario_shock
.
Usage
scenario_return_previous_trajectory(
df,
dip_year = 2020,
recovery_year = 2022,
start_year = 2018,
end_year = 2025,
value_col = "value",
scenario_col = "scenario",
scenario_name = "return_previous_trajectory",
scenario_shock = "covid_shock",
scenario_previous_trajectory = "pre_covid_trajectory",
trim = TRUE,
small_is_best = FALSE,
keep_better_values = FALSE,
upper_limit = 100,
lower_limit = 0,
trim_years = TRUE,
start_year_trim = start_year,
end_year_trim = end_year,
source = sprintf("WHO DDI, %s", format(Sys.Date(), "%B %Y"))
)
Arguments
- df
Data frame in long format, where 1 row corresponds to a specific country, year, and indicator.
- dip_year
(integer) year where the dip appends
- recovery_year
(integer) year from which the AROC will be applied
- start_year
Base year for contribution calculation, defaults to 2018.
- end_year
End year(s) for contribution calculation, defaults to 2019 to 2025.
- value_col
Column name of column with indicator values.
- scenario_col
(character) name of the column with the scenarios.
- scenario_name
name of scenario
- scenario_shock
(character) name of the scenario with the shock
- scenario_previous_trajectory
(character) name of the scenario with the previous trajectories.
- trim
logical to indicate if the data should be trimmed between
upper_limit
andlower_limit
.- small_is_best
Logical to identify if a lower value is better than a higher one (e.g. lower obesity in a positive public health outcome, so obesity rate should have small_is_best = TRUE).
- keep_better_values
logical to indicate if "better" values should be kept from
value_col
if they are present. Follows the direction set insmall_is_best
. For instance, if small_is_best is TRUE, thenvalue_col
lower thancol
will be kept.- upper_limit
upper limit at which the indicator should be caped.
- lower_limit
lower_limit limit at which the indicator should be caped.
- trim_years
logical to indicate if years before
start_year_trim
and afterend_year_trim
should be removed- start_year_trim
(integer) year to start trimming from.
- end_year_trim
(integer) year to end trimming.
- source
Source to provide for calculated average service coverage and single measure.