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

Cross-fold validation of heterogeneity

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

Follow the analysis.

Select a node to explore the method

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

K-fold split (e.g. K = 5)

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

What happens here

Partition units into K folds; each unit's CATE will be predicted from a forest trained without it.

Reads fromNot specified Feeds into#2#3
Key code
folds <- sample(rep(1:5, length.out = n))   # cross-fit by fold
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 single dataset (X, W, Y) — no separate evaluation sample needed.

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

2 figures Workflow discussion 0
01FigureA K=5 fold split: each fold is held out in turn so nothing is evaluated on its own training data.
02FigureCross-fold RATE estimates combined across the folds into one honest summary.

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

Context & interpretation

The GRF 'Cross-fold validation of heterogeneity' tutorial. Sample-splitting RATE wastes half the data; K-fold cross-fitting fixes that while keeping the priorities out-of-sample at every unit. Unofficial summary.

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion