Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 005
Research workflow/8 steps

Heterogeneous treatment effects with a causal forest (GRF recipe)

Source grf — Athey, Tibshirani & Wager
01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 8 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 8
01
Data prep

[GRF] Regression forest

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Cross-fit Y.hat = E[Y|X] and W.hat = E[W|X] so the causal forest splits on orthogonalized residuals.

Formula
\hat\mu(x)=\mathbb{E}\!\left[\,Y\mid X=x\,\right]
The estimator

Regression forest — Honest non-parametric regression for E[Y|X], with out-of-bag predictions and pointwise CIs.

Reads fromNot specified Feeds into#2
Key code
rf <- regression_forest(X, Y)
Y.hat <- predict(rf)$predictions
Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

A randomized/observational study: covariate matrix X, binary treatment W, outcome Y.

Show data format & exampleHide example

Format — one row per unit. A covariate matrix X (numeric), a binary treatment W ∈ {0,1}, and an outcome Y.

  X1     X2    X3    W    Y
 0.42  -1.1   0     1   3.10
-0.07   0.6   1     0   1.85
 1.20   0.3   0     1   4.02
03
Read the evidence

Results & interpretation

4 figures Workflow discussion 3
01FigureOut-of-bag CATE estimates τ̂(x) across the sample — the spread is the heterogeneity you're after.
02FigureHow a causal forest splits: it carves out neighbourhoods that maximise the contrast in treatment effect.
03FigureTargeting operator characteristic (TOC) when units are ranked by the financial-autonomy effect.
04FigureTOC for the cognitive-impairment outcome — benefit concentrates in the top-ranked units.

Figures reproduced from grf — Athey, Tibshirani & Wager — unofficial community showcase; all credit to the original authors.

Context & interpretation

What the GRF docs recommend end-to-end for credible heterogeneous-effect analysis. Nuisances are cross-fit first; the causal forest is then validated (calibration), summarized (AIPW ATE, best linear projection), stress-tested for useful heterogeneity (RATE/AUTOC), and finally turned into a targeting policy. Unofficial summary of the public GRF tutorials.

Peer notes

Discuss the workflow (3)

  • 6

    This is the canonical order and I wish more papers followed it. Calibration BEFORE you start interpreting subgroups, every time.

    2

    And RATE before policy learning — no point optimizing a rule on heterogeneity that isn't there.

  • 3

    Bookmarking this as the onboarding doc for new analysts. The fan-out from the forest into ATE / BLP / RATE / policy is exactly how I teach it.

  • 6

    The fact that one causal_forest object feeds all four downstream branches is the whole pitch for GRF. Compose, don't re-fit.

IN THE MARGINS

Peer discussion