Individualized treatment rule (ITR) estimation for the WISDM T1D clinical trial (Pratley et al., 2020). For full details of this project, please refer to the paper:
Kahkoska, A. R., Shah, K. S., Kosorok, M. R., Miller, K. M., Rickels, M. R., Weinstock, R. S., Young, L., & Pratley, R. (in press). Estimation of a machine learning-based decision rule to understand heterogeneous effects of continuous glucose monitoring on hypoglycemia among older adults with type 1 diabetes: A post-hoc analysis of the WISDM study. Journal of Diabetes Science and Technology.
This repository currently contains code to reproduce analyses related to the secondary outcome of the paper: change in CGM-measured percentage of time spent in hypoglycemic range (<70 mg/dL) between baseline and follow-up.
This repository contains an end-to-end precision medicine workflow which estimates an individualized treatment rule (ITR) for older adults with type 1 diabetes (T1D). In this trial, continuous glucose monitoring (CGM) was compared with traditional blood glucose monitoring (BGM) for its effect on hypoglycemia (reduction in time spent in hypoglycemia, defined as blood glucose < 70 mg/dL).
- Data Processing:
- Compilation of variables, treatment information, and clinical outcome (and omission of patients lost to follow-up)
- Selection of final features for analysis
- Model Fitting:
- Model Evaluation:
- Empirical value function approximation for resulting ITRs
- Nested K-fold cross validation for parameter tuning, optimal model selection, and optimal model evaluation on held-out test set
- Compilation of Results:
- Optimal decision rule, defined by patient coefficient of variation (%CV)
- Characteristics of study participants, stratified by decision rule subgroup
- Visualization of differences in CGM vs. BGM treatment effects, stratified by baseline coefficient of variation (%CV)
- Training/validation set estimates of potential decision rules, along with held-out test set evaluation of optimal rule
All data used in this analysis are publicly available through the Jaeb Center for Health Research (JCHR) and can be accessed in two ways:
- Direct link: https://public.jaeb.org/dataset/564
- Visit https://public.jaeb.org/datasets/diabetes and click `WISDMPublicDataset.zip'
- Create the following empty folders from the root directory:
/data
and/data/study data
- Download study data, unzip, and copy all text files into the
study data
folder - Run
C00data_processing.R
, which will output a clean dataset (dat_clean_XAY_full.rds
) into/data
- Run
C20decision_list.R
andC21policy_tree.R
, which will output the following into/data
:decision_list_CV.rds
: Cross validation results for decision lists with different depth parameterspolicy_tree_CV.rds
: Cross validation results for policy trees with different depth parametersoptimal_CV.rds
: Held-out test set cross validation result for optimal decision rule, CGM-only rule, and BGM-only ruledat_opt.rds
: Dataset with column of optimal predicted treatments added
- Run
C30results.R
, which compiles all outputted files and calculates final results
scripts/C00data_processing.R
: Processes all data and outputs a clean dataset for analysis- Dependencies: Study data in
data/study data
- Output:
dat_clean_XAY_full.rds
- Dependencies: Study data in
scripts/C20decision_list.R
: Runs functions for decision list fitting and value estimation- Dependencies:
F10CV_base.R
,F20decision_list.R
- Output:
decision_list_CV.rds
- Dependencies:
scripts/C21policy_tree.R
: Runs functions for policy tree fitting and value estimation- Dependencies:
F10CV_base.R
,F21policy_tree.R
- Outputs:
policy_tree_CV.rds
,optimal_CV.rds
,dat_opt.rds
- Plots optimal decision rule (a policy tree with depth = 1)
- Dependencies:
scripts/C30results.R
:- Dependencies:
dat_clean_XAY_full
,dat_opt
,decision_list_CV
,policy_tree_CV
, study data indata/study data
- Outputs:
- [figure] Difference in CGM vs. BGM treatment effect on outcome (by baseline %CV)
- [table] Characteristics of study participants (stratified by decision rule subgroup)
- [table] All cross validation results for parameter tuning and optimal final model
- Dependencies:
scripts/F10CV_base.R
: Supporting file containing functions to create splits for inner and outer training/testing folds (nested K-fold cross validation)scripts/F20decision_list.R
: Supporting file containing functions to fit decision list algorithm and calculate cross validated value estimates of resulting decision rulescripts/F21policy_tree.R
: Supporting file containing functions to fit policy tree algorithm and calculate cross validated value estimates of resulting decision rule