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

Heterogeneous effects with causal-forest double ML (EconML)

Source EconML — Microsoft Research (ALICE)
01
The method workspace

Follow the analysis.

Select a node to explore the method

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

Split features: effect-modifiers X vs controls W

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

What happens here

Decide what the effect is allowed to vary over (X) and what is merely confounding to adjust for (W). The target is the CATE.

Formula
\tau(x)=\mathbb{E}\big[\,Y(1)-Y(0)\mid X{=}x\,\big]
Reads fromNot specified Feeds intoNot specified
Key code
# Y outcome, T treatment, X effect modifiers, W controls

Reference / docs ↗

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

Outcome Y, treatment T, the effect-modifiers X you want to vary the effect over, and controls W to adjust for.

Show data format & exampleHide example

Format — outcome Y, treatment T, effect-modifiers X, controls W (one row per unit).

from econml.orf import DMLOrthoForest
est = DMLOrthoForest(n_trees=1000)
est.fit(Y, T, X=X, W=W)
tau = est.effect(X_test)        # τ(x) at new points
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 2
01FigureEconML's Orthogonal Random Forest recovers the heterogeneous effect τ(x) as a function of a covariate — the ORF estimate tracks the true effect closely.

Figures reproduced from EconML — Microsoft Research (ALICE) — unofficial community showcase; all credit to the original authors.

Context & interpretation

⚠️ Unofficial community showcase of econml. Not affiliated with the authors; all credit to them.

Double machine learning with a forest final stage: partial out nuisance with flexible learners, then read the conditional effect τ(x) — with valid confidence intervals.

Peer notes

Discuss the workflow (2)

  • 2

    CausalForestDML with honest intervals is my default for CATE now. The orthogonalization makes the first-stage choice forgiving.

  • 0

    Residual-on-residual plus forest weights — clean. How are you choosing the number of trees in practice?

    1

    Crank it until the intervals stabilise; 1–2k trees is usually plenty, and bootstrap-of-little-bags handles the inference.

IN THE MARGINS

Peer discussion