Data Processing
DataProcessing.Rd
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:
Read the data: This function reads the data from the location specified
data <- readRDS("data.rds")
.gen_data_weighted
: Calculates weighted mean values for various metrics over yearsdata_weighted <- gen_data_weighted(data)
.gen_data_weighted_rf
: Calculates the differences between intervention and baseline values for risk factorsdata_weighted_rf_wide_collapse <- gen_data_weighted_rf(data_weighted)
.gen_data_weighted_ds
: Calculates the differences between intervention and baseline values for incidencesdata_weighted_ds_wide_collapse <- gen_data_weighted_ds(data_weighted)
.gen_data_weighted_burden
: Calculates the differences between intervention and baseline values for burden of diseasedata_weighted_burden_wide_collapse <- gen_data_weighted_burden(data_weighted)
.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 diseasedata_weighted_burden_spline <- gen_data_weighted_burden_spline(data_weighted_burden_wide_collapse)
.gen_data_le
: Calculates life expectancy for various age and groupsdata_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)