Get ITHIM-results into correct format for VoI analysis
Source:R/extract_data_for_voi.R
extract_data_for_voi.Rd
This function extracts the relevant information from the multi_city_ithim object and gets the results into the correct format for further analysis.
Usage
extract_data_for_voi(
NSCEN,
NSAMPLES,
SCEN_SHORT_NAME,
outcome_age_groups,
cities,
multi_city_ithim
)
Arguments
- NSCEN
number of scenarios (not incl. baseline)
- NSAMPLES
number of model runs per city
- SCEN_SHORT_NAME
names of the scenarios (incl. baseline)
- outcome_age_groups
outcome age groups as defined as input parameters to the model
- cities
list of cities for which the model was run
- multi_city_ithim
list containing the ithim model information including results for the various model runs
Value
ithim_results list with the following objects:
summary_ylls_df: dateframe with total ylls (median, 5th and 95th percentiles) per age group and city (plus combined results)
voi_data_all_df: dataframe for all cities with all outcomes for all model runs, age groups and disease and scenario combinations
yll_per_hundred_thousand: yll per 100,000 people for each city, outcome age category, model run and disease and scen combination
yll_per_hundred_thousand_stats: total ylls per 100,000 (median, 5th and 95th percentiles) as sum across all disease per outcome age group, scenario and city (plus combined results)
outcome: total yll outcome for all outcome age categories per city and scenario and disease combination, also combined city result (sum)
Details
The function performs the following steps:
by looping through the cities:
calculate average outcome (yll) per person in the population considered by the model
calculate the total ylls per 100 000 for each outcome age category, scenario and disease combination and model run
calculate total yll outcome across all outcome age categories per city and scenario and disease combinations
create one dataframe for all cities with all outcomes for all model runs, age groups and disease and scenario combinations
compute yll per hundred thousand by outcome age group by summing across all diseases (double counting!) by city and scenario and also summing across all cities
create one dateframe with total ylls (median, 5th and 95th percentiles) per age group and city (plus combined results as sum across all cities)