Skip to contents

This file contains a set of functions designed to work together for processing the data. Below is a description of how to use these functions in sequence.

Details

Step-by-Step Usage:

  1. Read the data: This function reads the data from the location specified data <- readRDS("data.rds").

  2. gen_data_weighted: Calculates weighted mean values for various metrics over years data_weighted <- gen_data_weighted(data).

  3. gen_data_weighted_rf: Calculates the differences between intervention and baseline values for risk factors data_weighted_rf_wide_collapse <- gen_data_weighted_rf(data_weighted).

  4. gen_data_weighted_ds: Calculates the differences between intervention and baseline values for incidences data_weighted_ds_wide_collapse <- gen_data_weighted_ds(data_weighted).

  5. gen_data_weighted_burden: Calculates the differences between intervention and baseline values for burden of disease data_weighted_burden_wide_collapse <- gen_data_weighted_burden(data_weighted).

  6. gen_data_weighted_burden_spline: Performs data smoothing for burden of disease, when necessary. For instance, with only a few simulations, there can be positive values in difference in burden of disease data_weighted_burden_spline <- gen_data_weighted_burden_spline(data_weighted_burden_wide_collapse).

  7. gen_data_le: Calculates life expectancy for various age and groups data_ple_wide <- gen_data_le(data_weighted).

Examples

# Example of using all functions together
data <- readRDS("data.rds")
data_weighted <- gen_data_mean(data)
data_weighted_rf_wide_collapse <- gen_data_weighted_rf(data_weighted)
data_weighted_ds_wide_collapse <- gen_data_weighted_ds(data_weighted)
data_weighted_burden_wide_collapse <- gen_data_weighted_burden(data_weighted)
data_weighted_burden_spline <- gen_data_weighted_burden_spline(data_weighted_burden_wide_collapse)
data_ple_wide <- gen_data_le(data_weighted)