
As-if random assignment, non-compliance, and the IV estimator
2026-10-26
recognise a natural experiment, “as-if random” assignment by nature, and why it trades a little internal validity for more external validity;
see how non-compliance turns an RCT into an intention-to-treat design, where the offer \(Z\) is not the treatment \(D\);
use an instrumental variable to recover the treatment effect for compliers (the Wald estimator \(\rho/\phi\)) and state the three IV assumptions.
Part 1 of 3
Some of the most important “treatments” can never be randomised. But sometimes the world randomises them for us.
What is the average causal effect of a terrorist attack on xenophobia?
It is claimed that attacks like 9/11 shift public attitudes. Can we show it, causally?




If we could randomly assign exposure to terrorism, treatment and control groups would come from the same population. They would be alike on everything, including their untreated potential outcome \(Y_0\):
\[E[Y_{0i} \mid D = 1] = E[Y_{0i} \mid D = 0]\]
The selection-bias term would vanish and the raw difference would be the causal effect \(\kappa\).
\[\begin{aligned} & \underbrace{E[Y_{1i} \mid D=1] - E[Y_{0i} \mid D=0]}_{\text{Comparison between treatment and control group}} \\[1.2em] &= E[Y_{0i} + \color{#901A1E}{\kappa} \mid D=1] - E[Y_{0i} \mid D=0], \\[1.2em] &= \color{#901A1E}{\kappa} + \underbrace{E[Y_{0i} \mid D=1] - E[Y_{0i} \mid D=0]}_{\underbrace{0}_{\text{Selection bias (if randomization has worked)}}}, \\[1.2em] &= \underbrace{\color{#901A1E}{\kappa}.}_{\text{The average causal effect}} \end{aligned}\]

Stanford Prison Experiment, 1971: “guards” with a blindfolded “prisoner”.
Photo: Philip Zimbardo.
Zimbardo randomly assigned student volunteers to be guards or prisoners in a mock prison. Guards humiliated and abused prisoners and the study was stopped after 6 of 14 planned days. Participants were traumatized and the researcher, acting as “superintendent”, let it escalate.

The first natural experiment: John Snow traced the 1854 London cholera outbreak to a water pump. Because rival companies’ pipes were laid haphazardly, which water a household got was as-if random, that is, unrelated to their wealth or health.

John Snow, 1813–1858.

Plaque honouring Snow.
Photo: Tony Hisgett.

Cholera killed fast and turned its victims blue: a victim in the “blue stage”, and cholera deaths across England and Wales. Image: via UCLA Dept. of Epidemiology.

“Salus Populi Suprema Lex”: George Cruikshank mocks the Southwark Water Works for piping sewage-filled Thames water to London homes, 1832. Image: via UCLA Dept. of Epidemiology.

The Southwark Water Company’s works on the Thames, before 1845. Image: via UCLA Dept. of Epidemiology.

Snow (1856) cholera map, 1854.

Snow’s 1855 map of the “grand experiment”: districts supplied by the Southwark & Vauxhall (blue) vs. the Lambeth company (red), whose pipes were laid haphazardly side by side. Image: Cooper Hewitt, public domain.
A natural experiment: exposure to treatment vs. control is as-if random, decided by nature or by forces outside the researcher’s control.
Legewie (2013) spotted a natural experiment: the 2002 Bali attack struck during the European Social Survey’s fieldwork. Whether a respondent was interviewed before or after the attack was as-if random; so “after” is the treatment group, “before” the control.

Joscha Legewie, Harvard University


Under what conditions is this design valid?
Internal validity: The estimated parameter, \(\beta_{I \rightarrow Y}\), really captures what the study claims it captures (e.g., a causal effect) in the study’s own sample and setting.

\(\rightarrow\) the RCT wins over the natural experiment, because the researcher controls assignment. The intervention \(I\) is therefore known to be random. We are sure no confounder \(C\) sneaks in.
External validity: The estimated parameter, \(\beta_{E \rightarrow Y}\), found in the study generalises to other people, places, times and real-world versions of the treatment.

\(\rightarrow\) The natural experiment wins over the RCT. We study a real event \(E\), not an artificial intervention; findings travel better. The price: we must assume \(E\) is as-if random (the “?” arrow), not know it.

Photo: Robert Vayssié.
Finding a natural experiment, not the statistics, is the hard, creative part. They are rare as truffles. Are you a lucky truffle pig?
Because the interview day is as-if random, Legewie estimates the causal effect of the Bali attack on anti-immigrant attitudes, country by country, with plain OLS.
What does the figure show? In which countries did the attack change anti-immigrant attitudes, and in which not?
The attack significantly raised xenophobia in Portugal, Poland & Finland — but had no detectable effect in Great Britain, the Netherlands, or Norway. The same shock, different societies: why is the next research question. You can find the answer in Legewie (2013).

Source: Legewie (2013)
ESS <- read_dta("Legewie_ESS_02.dta") %>%
mutate(
int_date = sprintf("%s-%s-%s", inwyr, inwmm, inwdd) %>% as.Date(), # Interview day
treat = case_when( # Treatment indicator
int_date > event_date & int_date <= event_date_end ~ "After the attack",
int_date < event_date & int_date > event_date_begin ~ "Before the attack",
TRUE ~ as.character(NA)) %>% fct_relevel("Before the attack", "After the attack"),
anti_immi = rowMeans(select(., imtcjob, imbleco, imbgeco, imueclt, # Average of 7 items,
imwbcnt, imwbcrm, imbghct), na.rm = TRUE) %>%
scale() %>% as.numeric(), # z-standardised,
anti_immi = max(anti_immi, na.rm = TRUE) - anti_immi, # high = xenophobic
brncntr = as_factor(brncntr), # Born in the country?
mocntr = as_factor(mocntr), # Mother born there?
facntr = as_factor(facntr), # Father born there?
pspwght = pweight * dweight) %>% # Weights
filter(str_detect(cntry, "PT") & # Portugal, and only people
brncntr == "yes" & mocntr == "yes" & facntr == "yes") %>% # without migration background
select(treat, anti_immi, cntry, pspwght) %>%
drop_na()You replicate Legewie: estimate the Bali effect for Portugal and Sweden, and make a coefficient plot; a real AJS-style analysis.
Open exercise 1 in a new tab ↗
Part 2 of 3
Even RCTs can run into a problem: you can offer a treatment, but you cannot force people to take it.
Does the neighbourhood you grow up in shape your future?
America’s inner cities in the 1970s: arson, abandonment, and whole blocks left in rubble.
What does growing up here do to a child?

Public housing, St. Louis, late 1960s.
Photo: USGS.

A burned-out tenement, South Bronx, 1980.
Photo: John Fekner.

A ruined building, South Bronx, 1980.
Photo: John Fekner.

Cleveland, 1973.
Photo: Frank J. Aleksandrowicz.
One of the largest social-science RCTs ever. ~4,600 low-income families in high-poverty housing were randomly offered a voucher to move to a low-poverty neighbourhood. The question: does growing up in a poor neighbourhood hold children back?

Raj Chetty and colleagues followed the MTO children into adulthood (Chetty, Hendren, and Katz, 2016).

Robert Taylor Homes, Chicago, 1973: the kind of high-poverty public housing MTO offered a way out of. Photo: John H. White.
But the lottery only randomised the offer, not the move. Families could decline or move anyway. So the randomly assigned \(Z\) (offer) is not the treatment \(D\) (actually moving).

You can offer the move; you cannot force it. A Chongqing “nail house” whose owners refused to leave, 2007. Photo: Zhou Shuguang.
Among families with young children who were offered the experimental voucher, only about 48% actually moved (Chetty, Hendren, and Katz, 2016).
This is (non-)compliance: the random \(Z\) (the offer) and the treatment \(D\) (moving) are not the same, \(|r_{Z,D}| < 1\); some move without a voucher, and some don’t move despite having won a voicher.

Take-up ≈ 0.4766. Source: Chetty, Hendren, and Katz (2016)

Compare everyone offered the voucher to everyone not offered, regardless of who moved. Because the offer was randomised, this intention-to-treat (ITT) difference is a clean causal effect: +$1,624 in adult earnings for kids whose parents were offered the move.
Because its randomized, its a causal effect;
but of what?
It is the causal effect of being offered the move \(Z\), not of actually moving \(D\). The kids of families who were offered a move, make (on average) $1,624 more than those who were not offered to move. This ITT of \(Z\) is a diluted effect of \(D\): an effect for the ~48% who moved, mixed with zero for the ~52% who stayed.

ITT ≈ +$1,624. Source: Chetty, Hendren, and Katz (2016)
Full-compliance RCT: the intervention is the treatment. \[|r_{I,D}| = 1 \;\Rightarrow\; I = D\] The randomised difference is the treatment effect directly.

ITT / (non-)compliance: the offer only nudges the treatment. \[|r_{Z,D}| < 1 \;\Rightarrow\; Z \neq D\] The randomised offer injects some random variation into \(D\); enough to work with.

The injected random variation in \(D\) is exactly what an instrumental variable exploits.
Part 3 of 3
Use the randomly-assigned offer as an instrument to recover the effect of the treatment itself.
Every IV argument juggles the same seven players.
| Symbol | Role | In Moving to Opportunity |
|---|---|---|
| \(Z\) | Instrument — randomly assigned | the voucher offer (the lottery) |
| \(D\) | Treatment — what we care about | actually moving to a low-poverty area |
| \(Y\) | Outcome | the child’s adult income |
| \(C\) | Confounders | why we can’t just compare movers: ambition, family resources … |
| \(\phi\) | First stage \(Z \rightarrow D\) | offer → move \(= 0.48\) |
| \(\rho\) | Reduced form \(Z \rightarrow Y\) (the ITT) | offer → income \(= \$1{,}624\) |
| \(\lambda\) | What we want \(D \rightarrow Y\) | move → income \(= \rho/\phi \approx \$3{,}400\) |
Goal: the causal effect \(\lambda\) of the treatment \(D\) on outcome \(Y\).
Three requirements for an instrument \(Z\):

Winning the lottery clearly makes families: 1. move (first stage ✓) 2. it was random (✓) \(\rightarrow\) two boxes ticked.
Discuss: could the random offer still reach a child’s income through some other path than moving — and so ruin the instrument?
Yes — for example if winning also sparked optimism that lifts earnings, whether or not the family moved. Then \(Z\) reaches \(Y\) through a second path: the exclusion restriction breaks. It is the one requirement you cannot test — you must argue it is implausible.
A violated exclusion restriction

The offer only moved 48% of families. So the offer’s effect on income, the $1,624 ITT, is a diluted effect of moving: a gain for the ~48% who moved, blended with zero for the ~52% who did not.
To undo the dilution, scale it back up by the share who actually moved: \[\lambda = \frac{\$1{,}624}{0.48} \approx \$3{,}400\]
In one line: a weak nudge that still shifted incomes must mean each real mover was affected a lot. Dividing the (small) reduced form by the (small) first stage recovers that full per-mover effect.
If everyone had complied (\(\phi = 1\)), the ITT would be the treatment effect — no scaling needed. Non-compliance is exactly why we divide.
Two effects we can estimate cleanly, because \(Z\) is random:
First stage — \(Z\)’s effect on the treatment \(D\): \[\phi = E[D \mid Z{=}1] - E[D \mid Z{=}0]\]
Reduced form — \(Z\)’s effect on the outcome (the ITT): \[\rho = E[Y \mid Z{=}1] - E[Y \mid Z{=}0]\]

If \(Z\) works only through \(D\), then \(\phi \times \lambda = \rho\), so: \[\lambda = \frac{\rho}{\phi} = \frac{\text{reduced form}}{\text{first stage}}\]
For MTO: \(\lambda = \dfrac{\$1{,}624}{0.4766} \approx \mathbf{\$3{,}400}\) — the effect of moving for those who move because of the offer.
Suppose the offer to move also affects income by some path \(\delta\) that bypasses moving out of the high-poverty neighborhood (e.g. optimism). Then the reduced form mixes two things: \[\rho = \underbrace{\phi \times \lambda}_{\text{through } D} + \underbrace{\color{#901A1E}{\delta}}_{\text{the leak}}\]
The Wald estimator divides all of \(\rho\) by \(\phi\): \[\frac{\rho}{\phi} = \lambda + \color{#901A1E}{\frac{\delta}{\phi}}\]
Intuition: dividing by \(\phi\) scales the ITT up to “what if everyone had complied”. But \(\delta\) works for everyone offered, complying mover or not, so scaling it up by \(\frac{1}{\phi}\) blows it up too. We additionally weigh up every other effect of \(Z\) by \(\frac{1}{\phi}\).

MTO in numbers: say winning the lottery adds just $200 to income directly. IV then reports \[\lambda + \frac{\$200}{0.48} \approx \lambda + \mathbf{\$420}\] The leak, \(\delta\), is more than doubled. With a weak first stage, say \(\phi = 0.1\), the same $200 becomes $2,000 of fake effect.
The instrument only moves the compliers, people who take the treatment because they were assigned it. So IV recovers a Local Average Treatment Effect: \[\lambda = E[Y_{1i} - Y_{0i} \mid \text{complier}]\]
Why a new letter? In Lecture 6 an RCT gave us \(\kappa\) — the effect for everyone. An instrument is weaker: \(\lambda\) is the same kind of causal effect, but only for the compliers. Same idea, narrower population — hence \(\lambda\), not \(\kappa\).

Instrumenting the move with the random voucher offer, Chetty, Hendren, and Katz (2016) recover the effect of actually moving as a young child: about +$3,477 in annual adult earnings.
Growing up in a low-poverty neighbourhood causally raises children’s later earnings \(\rightarrow\) place shapes destiny, for the compliers whose move the lottery caused.

IV / treatment-on-treated ≈ +$3,477. Source: Chetty, Hendren, and Katz (2016)
The Minneapolis Domestic Violence Experiment. Sherman and Berk (1984) randomly told officers how to respond when called to intervene in a domestic violence case — but officers did not always comply.
# The data ship with the masteringmetrics package
data("mdve", package = "masteringmetrics")
mdve <- mdve %>%
mutate(
T_RANDOM = case_when( # What officers were TOLD to do
T_RANDOM == 2 | T_RANDOM == 3 ~ "Coddle!",
T_RANDOM == 1 ~ "Arrest!",
TRUE ~ as.character(NA)),
T_FINAL = case_when( # What officers actually DID
T_FINAL == 2 | T_FINAL == 3 ~ "Coddled",
T_FINAL == 1 ~ "Arrested",
TRUE ~ as.character(NA)))Discuss: which cells are the compliers? And who are the others?

Domestic violence (staged, make-up). Photo: Commonpersoon, CC0.

A Copenhagen Police patrol car. Photo: Dk-2100, CC BY-SA 3.0.
Does arresting domestic-violence suspects deter repeat offences? The Minneapolis experiment had non-compliance too. You compute the IV estimate yourself.
Open exercise 2 in a new tab ↗
A natural experiment exploits as-if random exposure created by nature; less control than an RCT, but real events and better external validity.
With non-compliance, the randomised \(Z\) is not the treatment \(D\). The intention-to-treat effect is the clean causal effect of \(Z\), diluted by everyone who didn’t comply.
An instrumental variable uses the random \(Z\) to recover the treatment effect \(\lambda = \rho/\phi\), if the first stage is real, \(Z\) is as-if random, and the exclusion restriction holds.
IV estimates a LATE: the effect only for compliers, assuming no defiers (monotonicity). It is silent about never- and always-takers.
Shaky on any of these? That is what this week’s Absalon quiz and the Friday exercise class are for.
estimatr::lm_robust(y ~ z, weights = ...): the reduced form (\(\rho\), effect of the offer) and — with the treatment as the outcome — the first stage (\(\phi\)).lambda <- rho / phi. No special function needed.haven::read_dta(): read a Stata (.dta) file, such as Legewie’s ESS data.as.Date(): turn text like "2002-10-13" into a date you can compare with < and >.str_detect(x, "PT"): does a text contain a pattern? Handy in filter().table(): cross-tabulate two variables, e.g. assigned vs. actual treatment.masteringmetrics::mdve: the Minneapolis domestic-violence experiment (exercise 2).ivreg::ivreg(y ~ d | z) runs the first stage, reduced form and division in one step — 2SLS.Chetty, R., N. Hendren, and L. F. Katz (2016). “The Effects of Exposure to Better Neighborhoods on Children: New Evidence from the Moving to Opportunity Experiment”. In: The American Economic Review, pp. 855-902.
Legewie, J. (2013). “Terrorist Events and Attitudes toward Immigrants: A Natural Experiment”. In: American Journal of Sociology, pp. 1199-1245.
Sherman, L. W. and R. A. Berk (1984). “The Specific Deterrent Effects of Arrest for Domestic Assault”. In: American Sociological Review, pp. 261-272.
Snow, J. (1856). “On the Mode of Communication of Cholera”. In: Edinburgh Medical Journal, pp. 668-670.

Lecture 7 · Natural experiments & IV