In a trial in Aceh, Indonesia, villages were randomly chosen to receive vitamin A capsules for young children, and one child in five in those villages did not receive one. Comparing children who took the capsule with those who did not overstates its effect, because the children who missed it were at far higher risk. This part applies the LATE framework to the published counts from the trial: 23,682 children, six numbers, and code to reproduce every figure in Stata, R and Python.
In this part
- The trial and the published counts
- Two comparisons that mislead
- The intention-to-treat effect and the first stage
- The Wald ratio: deaths averted per 1,000 compliers
- Who the compliers are, and their death rates
- Do the four assumptions hold?
- The code and its output
- Standard errors and village randomisation
- Check your understanding
- Three questions about this trial
- Where next
1. The trial and the published counts
Vitamin A deficiency weakens resistance to infection in young children. In the 1980s a trial in Aceh province, Indonesia, tested whether a high-dose capsule reduces child deaths (Sommer et al., 1986). The unit of randomisation was the village: of 450 villages, 229 were assigned to receive capsules and 221 served as controls, receiving none during the study. In assigned villages the capsules were distributed to young children, and some children did not receive them.
The data we use are the counts for 23,682 children reported by Sommer and Zeger (1991). In the notation of part 3: \(Z_i = 1\) if child \(i\)'s village was assigned to receive vitamin A, \(W_i = 1\) if the child received it, and the outcome is whether the child died during the trial's follow-up. We measure the outcome in deaths per 1,000 children, \(Y_i = 1{,}000 \times \mathbf{1}\{\text{died}\}\), so that every mean and every coefficient below reads as deaths per 1,000.
| Village assigned (\(Z_i\)) | Child received capsule (\(W_i\)) | Children | Deaths | Deaths per 1,000 |
|---|---|---|---|---|
| No (control) | No | 11,588 | 74 | 6.39 |
| Yes | No | 2,419 | 34 | 14.06 |
| Yes | Yes | 9,675 | 12 | 1.24 |
No child in a control village received a capsule: the cell \(Z_i = 0, W_i = 1\) is empty. This is one-sided noncompliance: assignment can fail to deliver the treatment, but nobody can obtain it without assignment.
What students say
“Nicky is an excellent econometrics tutor. He explains complex concepts clearly and makes them much easier to understand.”
“I was completely lost in my economics class, and then I started working Nicky and he totally saved me. He was excellent at explaining the material and extremely accommodating to meet with me many times despite us being in different time zones! Highly recommend working with Nicky!”
“Nicky is a very good and thorough teacher. He has excellent knowledge of econometrics and takes the time to work through your questions. Highly recommended!”
“Really great tutor! Encouraging, knowledgeable, friendly”
“Very good lesson, Nicky is very helpful.”
“Very helpful and clear.”
“I gather it was very useful, thank you!”
“Fantastic!”
2. Two comparisons that mislead
The as-treated comparison sets the children who received a capsule against all who did not. Those who did not are the 11,588 control children and the 2,419 in assigned villages who missed out: 108 deaths among 14,007 children, 7.71 per 1,000. Against 1.24 for those who received it, the difference is 6.47 deaths per 1,000.
The per-protocol comparison drops the children who were assigned but did not receive a capsule, and sets 1.24 against the control villages' 6.39: a difference of 5.15 per 1,000.
Both comparisons treat receipt as if it were randomly assigned, and it was not. Children in assigned villages who missed the capsule died at 14.06 per 1,000, more than twice the rate in control villages, where nobody received it. Missing the capsule went with something that also raised the risk of death; distance from where capsules were handed out, illness and poverty are candidates, and the data do not say which. This is the selection problem of part 1: the children who took the treatment had a lower risk of death without it (section 5 estimates how much lower). The randomised assignment is not affected by this, which is why we use it as the instrument.
3. The intention-to-treat effect and the first stage
Compare all children by their village's assignment, whatever they received. Assigned villages: 46 deaths among 12,094 children, 3.80 per 1,000. Control villages: 6.39 per 1,000. So, in deaths per 1,000 children,
$$ ITT_Y = 3.804 - 6.386 = -2.582 $$With village assignment random, this is the effect of assigning a village to the programme on its children's death rate, including the children it did not reach. The first stage is the share of children in assigned villages who received a capsule, since nobody in a control village did:
$$ ITT_W = \frac{9{,}675}{12{,}094} - 0 = 0.800 . $$4. The Wald ratio: deaths averted per 1,000 compliers
Dividing the two, as in part 3, section 2, in deaths per 1,000,
$$ \frac{ITT_Y}{ITT_W} = \frac{-2.582}{0.800} = -3.23 $$Under the four LATE assumptions of part 3, section 7, which section 6 examines, this is the effect of the capsule on the death rate of compliers: about 3.2 deaths averted per 1,000 children who receive a capsule when their village is assigned. Two-stage least squares gives the same number with its standard error: -3.23 (robust standard error 1.16; 95% interval -5.50 to -0.96, with the caveat of section 8). The as-treated difference of -6.47 is twice the size.
5. Who the compliers are, and their death rates
One-sided noncompliance pins down the types. Nobody in a control village could obtain a capsule, so \(W_i(0) = 0\) for every child: there are no always-takers and no defiers. Every child is a complier (would receive a capsule if the village is assigned) or a never-taker (would not). Under independence each type has the same share in both kinds of village, and the first stage gives the shares: 80.0% compliers and 20.0% never-takers.
The compliers' death rates with and without the capsule can also be estimated.
- Never-takers. In assigned villages the children who did not receive a capsule are all never-takers, and they died at 14.06 per 1,000. Under independence and exclusion, never-takers in control villages die at the same rate in expectation, because neither group received vitamin A and assignment affects them through no other channel.
- Compliers without vitamin A. Control villages hold 80% compliers and 20% never-takers, none treated, so \(6.39 = 0.80 \times r_C + 0.20 \times 14.06\), where \(r_C\) is the compliers' untreated death rate. Solving, $$ \begin{aligned} r_C &= (6.386 - 0.20 \times 14.055) / 0.80 \\ &= 3.575 / 0.80 = 4.47 \text{ per 1,000.} \end{aligned} $$
- Compliers with vitamin A. In assigned villages the children who received a capsule are all compliers: 1.24 per 1,000.
| Type | Share | Deaths per 1,000 without a capsule | Deaths per 1,000 with a capsule |
|---|---|---|---|
| Complier | 0.80 | 4.47 (estimated) | 1.24 |
| Never-taker | 0.20 | 14.06 | not observed |
The difference for compliers, \(1.24 - 4.47 = -3.23\), is the Wald ratio, and these three steps are part 4's proof in this setting. The never-takers would die at about three times the compliers' rate without treatment (14.06 against 4.47), so the as-treated comparison set treated compliers against a group heavily weighted with high-risk children. And the estimated effect for compliers is a fall from 4.47 to 1.24 deaths per 1,000, about 72% lower, though with only 12 deaths among treated children this proportion is imprecise.
With one-sided noncompliance the LATE is also the average effect on the treated (part 2): everyone treated is a complier in an assigned village, and independence makes them like compliers anywhere. It is not the ATE. The never-takers, a fifth of the children and the group at highest risk, never received a capsule, so the data say nothing about how much it would help them.
6. Do the four assumptions hold?
Independence. Villages were assigned at random, so a child's assignment is independent of the child's potential outcomes and decisions. Randomising villages rather than children does not change this; it changes the standard errors (section 8).
Monotonicity holds by the design: with no capsules in control villages, \(W_i(1) \ge W_i(0) = 0\) for every child.
Relevance is not in doubt: the first stage is 0.80.
Exclusion says assignment changes a child's chance of death only through the child's own capsule. Two routes could break it. First, the trial had no placebo, so families and health workers knew which villages were in the programme, and the visits that distributed capsules could have changed care in other ways. Second, if vitamin A shortens or lessens infections that pass between children, such as measles and diarrhoeal disease, treating 80% of a village's children could reduce their spread and so lower the risk for the untreated 20%. Either route moves the death rate in assigned villages by a channel other than the child's own capsule. If both lower deaths, \(ITT_Y\) includes them and the Wald ratio, which assigns the whole \(ITT_Y\) to compliers' own treatment, overstates the effect of the capsule itself (as in part 5, section 1). The second route is also a failure of the assumption that a child's outcome depends only on the child's own treatment, which the potential-outcomes notation \(Y_i(w)\) takes for granted.
Running IV on your own data in Stata, R or Python?
Send me the code, the output and what your supervisor or module asks for. I will help you read the first stage, the ITT and the IV estimate, starting with a free 30-minute consultation.
7. The code and its output
The code builds the 23,682 records from the six counts, then computes the group means, the two ITT regressions and two-stage least squares. Robust standard errors are used throughout: HC1 for the regressions, and the robust form without a degrees-of-freedom correction for IV, which is what Stata's ivregress ... , vce(robust), R's vcovHC(type = "HC0") and Python's linearmodels report. The full scripts are in Stata, R and Python.
Stata: the code
* LATE in a medical trial: vitamin A supplements and child mortality (Aceh, Indonesia) * Dr Nicky Grant, drnickygrant.com * The six published cell counts (Sommer and Zeger 1991): z = 1 if the child's * village was offered vitamin A, w = 1 if the child received it, * died = 1 if the child died during follow-up clear input z w died n 0 0 1 74 0 0 0 11514 1 0 1 34 1 0 0 2385 1 1 1 12 1 1 0 9663 end expand n drop n generate deaths = 1000*died // deaths per 1,000 children * Means by assignment, then by assignment and receipt tabstat w deaths, by(z) table (z w), statistic(frequency) statistic(mean deaths) * First stage and outcome ITT, with robust standard errors regress w z, vce(robust) scalar fs = _b[z] regress deaths z, vce(robust) display "Wald ratio: " _b[z]/fs * Two-stage least squares gives the Wald ratio with its standard error ivregress 2sls deaths (w = z), vce(robust) * The as-treated comparison, for contrast regress deaths w
Stata: the ITT regression, the Wald ratio and two-stage least squares
. regress deaths z, vce(robust)
Linear regression Number of obs = 23,682
F(1, 23680) = 7.75
Prob > F = 0.0054
R-squared = 0.0003
Root MSE = 70.995
------------------------------------------------------------------------------
| Robust
deaths | Coefficient Std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
z | -2.582378 .9278661 -2.78 0.005 -4.401055 -.7637004
_cons | 6.385916 .7400049 8.63 0.000 4.935459 7.836374
------------------------------------------------------------------------------
. display "Wald ratio: " _b[z]/fs
Wald ratio: -3.2280386
. ivregress 2sls deaths (w = z), vce(robust)
Instrumental variables 2SLS regression Number of obs = 23,682
Wald chi2(1) = 7.76
Prob > chi2 = 0.0054
R-squared = 0.0015
Root MSE = 70.95
------------------------------------------------------------------------------
| Robust
deaths | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
w | -3.228039 1.159163 -2.78 0.005 -5.499956 -.956121
_cons | 6.385916 .7399736 8.63 0.000 4.935595 7.836238
------------------------------------------------------------------------------
Endogenous: w
Exogenous: z
R: the code
# LATE in a medical trial: vitamin A supplements and child mortality (Aceh, Indonesia)
# Dr Nicky Grant, drnickygrant.com. Needs: install.packages("AER")
suppressPackageStartupMessages(library(AER)) # ivreg(), coeftest(), vcovHC()
# The six published cell counts (Sommer and Zeger 1991): z = 1 if the child's
# village was offered vitamin A, w = 1 if the child received it,
# died = 1 if the child died during follow-up
cells <- data.frame(z = c(0, 0, 1, 1, 1, 1),
w = c(0, 0, 0, 0, 1, 1),
died = c(1, 0, 1, 0, 1, 0),
n = c(74, 11514, 34, 2385, 12, 9663))
df <- cells[rep(seq_len(nrow(cells)), cells$n), c("z", "w", "died")]
df$deaths <- 1000 * df$died # deaths per 1,000 children
# Means by assignment, then by assignment and receipt
aggregate(cbind(w, deaths) ~ z, data = df, FUN = mean)
aggregate(deaths ~ z + w, data = df, FUN = function(v) c(n = length(v), mean = mean(v)))
# First stage and outcome ITT, with robust standard errors
first <- lm(w ~ z, data = df)
itt <- lm(deaths ~ z, data = df)
coeftest(itt, vcov = vcovHC(itt, type = "HC1"))
coef(itt)["z"] / coef(first)["z"] # the Wald ratio
# Two-stage least squares gives the Wald ratio with its standard error
iv <- ivreg(deaths ~ w | z, data = df)
coeftest(iv, vcov = vcovHC(iv, type = "HC0"))
coefci(iv, vcov = vcovHC(iv, type = "HC0"), df = Inf)
# The as-treated comparison, for contrast
coef(lm(deaths ~ w, data = df))["w"]
R: what it prints
z w deaths
1 0 0.0000000 6.385916
2 1 0.7999835 3.803539
z w deaths.n deaths.mean
1 0 0 11588.000000 6.385916
2 1 0 2419.000000 14.055395
3 1 1 9675.000000 1.240310
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.38592 0.74000 8.6296 < 2.2e-16 ***
z -2.58238 0.92787 -2.7831 0.005388 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
z
-3.228039
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.38592 0.73997 8.6299 < 2e-16 ***
w -3.22804 1.15916 -2.7848 0.00536 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
2.5 % 97.5 %
(Intercept) 4.935595 7.836238
w -5.499956 -0.956121
w
-6.47012
Python: the code
# LATE in a medical trial: vitamin A supplements and child mortality (Aceh, Indonesia)
# Dr Nicky Grant, drnickygrant.com. Needs: pandas, statsmodels, linearmodels
import pandas as pd
import statsmodels.formula.api as smf
from linearmodels.iv import IV2SLS
# The six published cell counts (Sommer and Zeger 1991): z = 1 if the child's
# village was offered vitamin A, w = 1 if the child received it,
# died = 1 if the child died during follow-up
cells = pd.DataFrame({"z": [0, 0, 1, 1, 1, 1],
"w": [0, 0, 0, 0, 1, 1],
"died": [1, 0, 1, 0, 1, 0],
"n": [74, 11514, 34, 2385, 12, 9663]})
df = cells.loc[cells.index.repeat(cells["n"])].drop(columns="n")
df["deaths"] = 1000 * df["died"] # deaths per 1,000 children
# Means by assignment, then by assignment and receipt
print(df.groupby("z")[["w", "deaths"]].mean().round(4))
print(df.groupby(["z", "w"])["deaths"].agg(["count", "mean"]).round(4))
# First stage and outcome ITT, with robust standard errors
first = smf.ols("w ~ z", data=df).fit(cov_type="HC1")
itt = smf.ols("deaths ~ z", data=df).fit(cov_type="HC1")
print(f"first stage {first.params['z']:.4f} outcome ITT {itt.params['z']:.4f}"
f" (se {itt.bse['z']:.4f}) Wald {itt.params['z'] / first.params['z']:.4f}")
# Two-stage least squares gives the Wald ratio with its standard error
iv = IV2SLS.from_formula("deaths ~ 1 + [w ~ z]", data=df).fit(cov_type="robust")
print(iv.summary.tables[1])
# The as-treated comparison, for contrast
asis = smf.ols("deaths ~ w", data=df).fit(cov_type="HC1")
print(f"as-treated difference {asis.params['w']:.4f}")
Python: what it prints
w deaths
z
0 0.0 6.3859
1 0.8 3.8035
count mean
z w
0 0 11588 6.3859
1 0 2419 14.0554
1 9675 1.2403
first stage 0.8000 outcome ITT -2.5824 (se 0.9279) Wald -3.2280
Parameter Estimates
==============================================================================
Parameter Std. Err. T-stat P-value Lower CI Upper CI
------------------------------------------------------------------------------
Intercept 6.3859 0.7400 8.6299 0.0000 4.9356 7.8362
w -3.2280 1.1592 -2.7848 0.0054 -5.5000 -0.9561
==============================================================================
as-treated difference -6.4701
Reading the IV output: the coefficient on \(w\) is the Wald ratio of section 4, -3.23 deaths per 1,000. The constant, 6.39, is the death rate in control villages. The standard error of 1.16 is close to the ITT's 0.93 divided by 0.80: the first stage is estimated precisely, so the uncertainty in the ratio comes almost entirely from the ITT.
8. Standard errors and village randomisation
Every standard error above treats the 23,682 children as independent. Villages were randomised, not children, and children in the same village share health services, water, disease outbreaks and the same capsule distribution, so their outcomes can be correlated. Standard errors that ignore this understate the uncertainty, and the correct ones cluster by village. The published counts do not record each child's village, so we cannot compute clustered standard errors here; the intervals above are narrower than they should be. Albert (2002) analyses this trial with a method for clustered responses and reports small correlations within villages in these data, which suggests the understatement here is modest.
9. Check your understanding
Why are there no always-takers in this trial, and what does that imply for monotonicity?
An always-taker would receive a capsule even in a control village, and no control child did. So \(W_i(0) = 0\) for everyone, which also rules out defiers: monotonicity holds by design.
The children in assigned villages who missed the capsule died at 14.06 per 1,000, against 6.39 in control villages. Does this show that being assigned and missing the capsule is harmful?
No. Those children are never-takers, a selected group. Control villages contain the same share of never-takers mixed with compliers who would have taken the capsule and are at lower risk. Under independence and exclusion, never-takers in control villages would also die at about 14 per 1,000.
If vitamin A given to some children reduced infections among their untreated neighbours, would the Wald ratio overstate or understate the capsule's effect on the children who took it?
Overstate (in absolute size). The spillover lowers deaths among never-takers in assigned villages, which makes \(ITT_Y\) more negative, and the Wald ratio attributes all of \(ITT_Y\) to the compliers' own treatment.
10. Three questions about this trial
Assignment can fail to deliver the treatment, but no one can obtain the treatment without assignment. There are then no always-takers or defiers, monotonicity holds automatically, and the Wald ratio equals the average effect on the treated. In the Aceh vitamin A trial no child in a control village received a capsule.
Divide the intention-to-treat effect on the outcome by the effect of assignment on treatment receipt. In the vitamin A trial, -2.58 deaths per 1,000 divided by 0.80 gives -3.23 deaths per 1,000 among compliers, valid under exclusion, independence and monotonicity.
Patients who take a treatment can differ from those who do not in ways that affect the outcome. In the vitamin A trial the children who missed the capsule died at 14.1 per 1,000 against an estimated 4.5 for compliers without it, and the as-treated difference, 6.47 per 1,000, is twice the Wald ratio of 3.23.
11. Where next
- Part 7: training and earnings in the Job Corps experiment, with two-sided noncompliance and all three types.
- Part 4: the LATE theorem, the general form of section 5's three steps.
- Heteroskedasticity and clustering, for cluster-robust standard errors.
References
- Albert, J. M. (2002). Estimating efficacy in clinical trials with clustered binary responses. Statistics in Medicine, 21, 649 to 661.
- Angrist, J. D., Imbens, G. W. and Rubin, D. B. (1996). Identification of causal effects using instrumental variables. Journal of the American Statistical Association, 91(434), 444 to 455.
- Sommer, A., Tarwotjo, I., Djunaedi, E., West, K. P., Loeden, A. A., Tilden, R. and Mele, L. (1986). Impact of vitamin A supplementation on childhood mortality: a randomised controlled community trial. The Lancet, 327(8491), 1169 to 1173.
- Sommer, A. and Zeger, S. L. (1991). On estimating efficacy from clinical trials. Statistics in Medicine, 10(1), 45 to 52.
Working on instruments or treatment effects? Send me the question
I tutor econometrics one-to-one at undergraduate, master's and PhD level, including instrumental variables, LATE, two-stage least squares and programme evaluation. Bring the question, the output or the dissertation chapter you are stuck on to a free 30-minute consultation.
Book a free 30-minute consultation PhD and postgraduate econometrics WhatsApp
Data. Cell counts from Sommer and Zeger (1991), for the trial reported by Sommer et al. (1986); the table and figure on this page are drawn from those counts. Written by Dr Nicky Grant from his lecture notes on instrumental variables and treatment effects; first published on drnickygrant.com on 23 November 2026. © 2026 Dr Nicky Grant. You are welcome to link to these notes and to quote short passages with a link to this page; please do not republish them.
