Heterogeneity of treatment effect analysis for randomized trials
Reproducible R Markdown pipelines for exploring treatment effect heterogeneity.
The problem
Most trials are designed to evaluate the average treatment effect over everyone enrolled. But an average effect can conceal meaningful variation: the treatment may help some patients more than others, have little effect for some, or even cause harm.
“Heterogeneity of treatment effect” (HTE) covers a family of questions about that variation. This pipeline approaches HTE from two complementary perspectives: how the average treatment effect varies with measured baseline characteristics, and how the individual treatment effects are distributed across patients.
Two approaches
Both are implemented in the HTE analysis pipeline.
How does the average treatment effect vary across observed baseline characteristics?
Model-based: A fit-the-fit approach. In the first stage, Bayesian Additive Regression Trees (BART) estimate the conditional average treatment effect (CATE) for each participant based on their baseline covariates. In the second stage, the estimated CATEs are used as dependent variables in classification and regression trees to identify covariate-defined subgroups with differential treatment effects.
Estimand: \(E[Y(1) - Y(0) \mid X]\), the conditional average treatment effect given measured baseline covariates.
How many patients benefit, and by how much?
Randomization-based. Confidence bounds for quantiles of the individual treatment effects are derived from the trial’s randomization mechanism alone, without modeling the covariates.
Because each patient is observed under one arm only, the distribution of individual effects is partially identified: the method returns confidence bounds rather than point estimates, and those bounds are finite-sample exact under the randomized assignment mechanism.
Estimand: Quantiles of \(\tau_i = Y_i(1) - Y_i(0)\) across the randomized sample.
When the outcome is truncated
Both approaches above assume the outcome is defined for everyone. For patient-centered outcomes that can only be measured on survivors, it is not: participants who die during follow-up have no outcome to observe, and comparing survivors between arms compares different sets of people, because survival is itself affected by treatment.
What is the effect among patients who would survive either way?
Heterogeneous survivor average causal effects. Principal stratification defines the estimand on the always-survivors stratum — participants who would survive under either arm. BART estimates the conditional survivor average causal effects (CSACE) there, using separate mean models for the potential outcomes and for latent stratum membership. The fit-the-fit step then applies as before, with a tree fitted to the estimated conditional effects.
Estimand: \(E[Y(1) - Y(0) \mid X, \text{always-survivor}]\).