HTE analysis pipeline
Treatment effect heterogeneity when the outcome is defined for every patient
The document below is the pipeline run end to end for randomized trials with a binary treatment. It is a single reproducible R Markdown file designed to accommodate both binary and continuous outcomes, with expensive computational steps cached so that re-running after an edit takes seconds rather than hours.
It is a large document with its own table of contents. Open it in a new tab and use the sidebar to move between parts.
What is in it
| Part | Contents |
|---|---|
| Setup and Configuration | Package installation, source files, the caching helper, and the global configuration block |
| Part I. A “fit-the-fit” approach | 1.1 BART estimation of conditional average treatment effects, with the per-patient CATE plot and MCMC diagnostics · 1.2 Subgroup discovery via classification and regression trees (CART) · 1.3 Variable importance and interaction (VIVI) heatmaps |
| Part II. Sensitivity analyses and cross-method comparison | 2.1 Sensitivity of the CATE estimates to the BART prior specification · 2.2 Cross-method comparison against Bayesian Causal Forest, XGBoost T- and S-learners, and causal forest |
| Part III. Treatment effect heterogeneity by prognostic score | 3.1 Prognostic score estimation · 3.2 Observed treatment effects across prognostic-score strata · 3.3 CATE as a function of the prognostic score, plus CART subgroup discovery by baseline prognosis |
| Part IV. Randomization-based inference for ITE quantiles | Simultaneous confidence bands for effect quantiles · confidence bounds on the proportion of patients who benefit |
| Appendix | The cache status for that knit |
Results shown on individual patient data are subject to each trial’s data use agreement. The source code is openly available so the method can be applied elsewhere.
Want to run this on your own trial? See the tutorial.