This is example codes with simulation data for HTE assessment using machine learning algorithms.
Manuscript Title: Machine Learning Approaches to Evaluate Heterogeneous Treatment Effects in Randomized Controlled Trials: A Scoping Review.
J Clin Epidemiol. 2024 Sep 19:111538.
https://www.jclinepi.com/article/S0895-4356(24)00294-4/fulltext
Lasso, Causal forest, Bayesian causal forest codes are created based on from their vignette
Meta-learner R codes are shown based on codes in: Salditt M, et al. A Tutorial Introduction to Heterogeneous Treatment Effect Estimation with Meta-learners.(Adm Policy Ment Health. doi:10.1007/s10488-023-01303-9). Please read the original paper for further information.
The codes have the following steps
###Step 1: Install packages
###Step 2: Set parameters and data generation
###Step 3: Creating datasets
###Step 4: Run analysis (Lasso, Causal forest, Bayesian Causal forest)
###Step 5: Run analysis (Meta-learner)
###Step 6: Evaluation of the model performance (example code for calibration)