Heterogeneous Treatment Effects

Causal machine learning for CATE and CRR in one R package

hte3 package badge showing a simple regression tree with subgroup treatment contrasts

hte3 helps practitioners estimate how treatment effects vary across people. It provides a high-level workflow for conditional average treatment effects (CATE) and conditional risk ratios (CRR), with access to the underlying sl3 learner framework when you need more control over the modeling choices.

Most analyses follow three steps: build a task, fit the estimand, then generate predictions or summaries.

  • CATE and CRR workflows
  • Built on sl3 and tmle3
  • High-level API with lower-level learner control

Start Here

What does the package actually estimate?

CATE

Conditional average treatment effects

Use CATE when your question is "for which types of units is treatment more or less helpful?" The output is a conditional mean difference, and the main entry point is fit_cate().

fit_cate(task, method = "dr")
CRR

Conditional risk ratios

Use CRR when a relative effect is more natural than a difference and the outcome is nonnegative. The output is a conditional risk-ratio surface, and the main entry point is fit_crr().

fit_crr(task, method = "ep")
Choose the estimand that matches your reporting goal, then choose the method inside that estimand.

Why hte3

Clear workflow, explicit method choice

The package keeps the main workflow concise while making the estimand, method, and learner choices explicit.

High-level workflow

Build an hte3_Task once with hte_task(), then fit with fit_cate() or fit_crr().

Explicit method selection

You do not have to guess which meta-learner is active. The site and the API keep DR, R, EP, T, and IPW workflows explicit.

Learner customization

See the sl3 guide for custom nuisance learners, learner libraries, and cross-fitting behavior.

Start with these functions: the R guide now has concise API cards for hte3_example_data(), hte_task(), fit_cate(), fit_crr(), predict(), and summary().

Method Explorer

Choose the method after you choose the estimand

The tabs below are organized the way practitioners usually think: first pick the estimand, then pick the modeling strategy.

Conditional Average Treatment Effects

Estimate how treatment effects vary across effect modifiers.

Wrapper note: fit_cate() supports DR, R, T, EP in the high-level API. fit_crr() supports EP, IPW, T. For continuous-treatment CATE, the supported high-level path is the R-learner under a partially linear A * tau(X) effect model. Lower-level CRR classes remain available through the advanced interface. When modifiers are a strict subset of confounders, prefer DR, EP, or the default two-stage T-learner for the V-conditional CATE target; the current R-learner instead targets an overlap-weighted projection and warns at fit time.
Continuous treatment supported

Residual-on-residual learning for effect heterogeneity

Good when

    Tradeoffs

      Main Call

      Method note:

      Workflow

      Three-step workflow

      Step 1

      Build a task

      Use hte_task() to define modifiers, confounders, treatment, and outcome. The task object keeps the analysis inputs explicit.

      Step 2

      Fit the estimand

      Call fit_cate() or fit_crr(), then choose the method that matches the estimand and modeling strategy.

      Step 3

      Predict and compare

      Use predict() and summary() to inspect the fitted surface.

      Guides

      Where to go next

      The landing page is for orientation. The two pages below are where you make concrete implementation choices.

      R package guide

      Installation, the high-level API cards, a compact quickstart, and links to the core vignettes.

      sl3 guide

      Learn where learners plug into hte3, what the default stack uses, and which upstream sl3 resources to read.

      Ecosystem

      Companion sites in the same calibration and causal-learning ecosystem

      If you are moving across related methods, these companion packages give the broader context for the design language and ideas around this package.

      calibratedDML package badge

      Companion package

      calibratedDML

      Calibrated debiased machine learning for causal effect inference with flexible nuisance learning.

      Open the calibratedDML website