Causal inference · Module 4: Machines and causes, in depth

Who benefits?

What is a causal forest?

4.2 · 3 min 21 s · published

A causal forest finds where a treatment effect is bigger or smaller. A causal tree splits the data with yes-or-no questions to find the groups whose effects differ most, and hundreds of slightly different trees are averaged into a forest. Stefan Wager and Susan Athey set out the method in 2018; a Ghana study used it on randomised fertiliser trials.

Key points

  • When an effect differs from place to place, it is called a heterogeneous effect.
  • Honesty: one half of the data chooses the splits; the other half estimates the effect in each group.
  • A forest estimates the average effect for units like this one, not the effect on one particular field.
  • Claims like “helps 80 per cent and harms 5 per cent” can’t be sorted out from data like these.

Chapters

  1. 0:00 Recap: cross-fitting
  2. 0:19 Averages hide
  3. 0:53 Trees that look for differences
  4. 1:33 Honesty
  5. 2:05 Groups, not individuals

Key terms

Causal forest
Hundreds of slightly different causal trees, averaged. Each tree splits the data with yes-or-no questions to find the groups whose treatment effects differ most. Set out by Stefan Wager and Susan Athey in 2018, causal forests estimate the average effect for units like a given one, not the effect on one particular field.
Heterogeneous effect
An effect that differs from place to place or unit to unit, such as a maize response to fertiliser of 2.8 tonnes a hectare in one zone of Ghana and 0.9 in another. An average effect answers “does it work, on the whole?”; a farmer asks “will it work on my farm?”
Honesty
A rule in causal forests: one half of the data chooses where to split, and the other half estimates the effect in each group. A tree can’t pick a group because it looks impressive and then report that same impressive number, which is what makes a forest’s uncertainty ranges trustworthy.
Effect modifier
A variable that changes how big an effect is, like zone for the maize response to fertiliser in Ghana, or farm size for the efficiency gain from organic olives. You don’t adjust a modifier away and report one number; you report the effect for each group, because a single average can be wrong almost everywhere.

Transcript

Last time's quick check: cross-fitting stops a model being judged on data it has memorised, so its flattering accuracy can't leak into the answer. An average effect answers one question: does it work, on the whole? A farmer asks another: will it work on my farm?

In Ghana, the typical maize response to fertiliser was 2.8 tonnes a hectare in one zone and 0.9 in another. Any single national figure would be wrong almost everywhere. When an effect differs from place to place, it's called a heterogeneous effect. A decision tree splits data into groups by asking yes-or-no questions: is rainfall above 800 millimetres? Is the soil sandy? Normally a tree splits to predict an outcome.

A causal tree splits to find the groups whose treatment effects differ most. Grow hundreds of slightly different trees, average them, and you have a causal forest. Stefan Wager and Susan Athey set out the method in 2018, and the Ghana study used it on yields from randomised trials.

Forests are very good at finding patterns, including ones that aren't there. So causal forests follow a rule called honesty. One half of the data chooses where to split; the other half estimates the effect in each group. A tree can't pick a group because it looks impressive and then report that same impressive number. That separation is what makes the forest's uncertainty ranges trustworthy.

One thing causal forests can't do is tell you the effect on one particular field or animal. Remember the ghost field: each unit shows only one outcome. What a forest estimates is the average effect for units like this one, with the same soil, rainfall and history.

So be wary of claims like "this treatment helps 80 per cent of people and harms 5 per cent". Data like these can't sort individuals into those groups. And a forest finds differences only along what you measured. In Ghana, the zones showed where the effect differed; the trials couldn't say why. Next: what to do once you have an answer. Try to break it.

Questions

Why do causal forests use honesty?

Forests are very good at finding patterns, including ones that aren’t there. Honesty splits the data: one half chooses where to split, and the other half estimates the effect in each group. A tree can’t pick a group because it looks impressive and then report that same impressive number, which is what makes the forest’s uncertainty ranges trustworthy.

Can a causal forest tell me the effect on my field?

Not exactly. Each field shows only one outcome, so no method sees the effect on one particular field. A forest estimates the average effect for units like yours, with the same soil, rainfall and history. And it finds differences only along what you measured: in Ghana the zones showed where the effect differed, not why.

Sources

  1. Kouame, A.K.K., Heuvelink, G.B.M. and Bindraban, P.S. (2026). Modeling and explaining fertilizer effect heterogeneity on maize yield in Ghana using causal and predictive machine learning. Field Crops Research, 337, 110287. doi:10.1016/j.fcr.2025.110287
  2. Wager, S. and Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228–1242. doi:10.1080/01621459.2017.1319839

All 30 films · Glossary · The Vitagri Academy

Follow the change in farming

Causal evidence is changing how farming is measured and rewarded. Leave your email and we will tell you when new films, courses and findings are published.

Prefer to read online? Vitagri also writes on Substack. See our privacy policy for how we use your email.