Causal inference · Module 2: Thinking in causal maps

Mediators

What is a mediator, and why shouldn’t you adjust for it?

2.4 · 3 min 58 s · published

A mediator sits on the path from treatment to outcome: it is how the effect gets there, like leaf zinc between a foliar spray and the grain. Adjust for it and you block the very route the treatment works through, so a treatment that works can appear to do nothing. The rule: never adjust for anything the treatment causes.

Key points

  • The total effect counts every route; the direct effect is what would happen if the mediator stayed the same.
  • Yield can be both a mediator and a collider between nitrogen and protein.
  • In Kenya, adding food, nutrition and hygiene support to a farm programme improved children’s height-for-age by 0.11 standard-score units.
  • More production alone may not improve nutrition: the route from farm to plate has to be built, not assumed.

Chapters

  1. 0:00 Recap: what not to adjust for
  2. 0:17 How an effect travels
  3. 0:46 Total and direct effects
  4. 1:23 A mediator can be a collider
  5. 1:51 From farm support to growth
  6. 3:03 The middle step

Key terms

Mediator
A variable on the path from treatment to outcome: how the effect gets there, like leaf zinc between a spray and the grain, or diet between farm support and child growth. Adjusting for a mediator blocks the route the treatment works through, so the rule is never to adjust for anything the treatment causes.
Total and direct effects
The total effect is what happens to the outcome when the treatment changes, by every route together; it is usually what a farmer wants to know. The direct effect is the part that doesn’t travel through a chosen mediator: protein if extra nitrogen were added but yield somehow stayed the same. Splitting an effect needs extra assumptions.
Collider
A variable with two arrows pointing into it, such as whether a grain sample reaches the lab when either good soil or a new treatment can send it there. A collider blocks association between its causes until you hold it fixed, by adjusting for it or selecting on it. Then a link appears from nowhere.

Transcript

Last time's quick check: never adjust for anything the treatment causes, and never for a collider. Today: the first of those, the mediator. A mediator sits on the path from treatment to outcome. It's how the effect gets there. Leaf zinc is the mediator between the spray and the grain.

Remember from 2.2: holding the middle of a chain fixed blocks it. So if you "control for" leaf zinc, you block the very route the spray works through, and the spray appears to do nothing. Not because it doesn't work, but because you've taken away the way it works.

Most effects travel by more than one route. Extra nitrogen raises grain protein directly. It also raises yield, and a bigger crop can dilute the protein in each grain. The total effect is what happens to protein when you add nitrogen, all routes together. That's usually what a farmer wants to know. The direct effect is what would happen if yield somehow stayed the same. That's a different question. Sometimes it's useful, but it isn't the answer to "should I apply it?"

Hold yield fixed, and you're no longer estimating the total effect. Yield hides a second trap. Weather drives both yield and protein. So nitrogen and weather both point into yield, which makes yield a collider as well as a mediator. Hold yield fixed and you open a route from nitrogen, through weather, to protein. You've removed part of the effect and added a bias. That's why the rule is so firm: never adjust for anything the treatment causes.

Mediators matter most where farming meets nutrition. In Kenya, a cluster-randomised trial gave some groups of farming families an agricultural programme alone, and others the same programme plus food, nutrition and hygiene support. Over two years, children's height-for-age improved by 0.11 standard-score units in the combined group. Their diets became more varied, with more iron-rich foods.

On a map, the extra support sits at the start of a chain: support, to a more varied diet, to child growth. Diet is a mediator, and measuring it helps show how the effect may have travelled. But the trial randomised the package, not the diet. So it can't say how much of the growth came through diet, or which part of the package did the work. Splitting an effect into its routes needs extra assumptions, starting with no hidden common cause of diet and growth.

The lesson the case study draws: more production alone may not improve nutrition. The route from farm to plate has to be built, not assumed. We've seen this shape before. In Module 1, maize became a staple without the alkaline cooking that frees its niacin, and pellagra followed.

The crop was the same; the step in the middle changed everything. Mediators are where farming's effects on nutrition are won or lost. Next: the variable you must never hold fixed, because doing so creates patterns out of nothing.

Questions

What is the difference between a total and a direct effect?

The total effect is what happens to the outcome when you change the treatment, by all routes together: extra nitrogen raises grain protein directly, and also raises yield, which can dilute the protein. The direct effect is what would happen if yield somehow stayed the same. The total effect is usually what a farmer wants to know.

What did the Kenya farm-and-nutrition trial show?

Groups of farming families were randomised to an agricultural programme alone, or the same programme plus food, nutrition and hygiene support. Over two years, children’s height-for-age improved by 0.11 standard-score units in the combined group, and their diets became more varied. Because the package was randomised, not the diet, it can’t say how much came through diet.

Sources

  1. Wegmüller, R., Musau, K., Vergari, L. et al. (2022). Effectiveness of an integrated agriculture, nutrition-specific, and nutrition-sensitive program on child growth in Western Kenya: a cluster-randomized controlled trial. The American Journal of Clinical Nutrition, 116(2), 446–459. doi:10.1093/ajcn/nqac098

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.