Assignment Z is randomised, but people need not comply. Four kinds of people exist: compliers follow the assignment, always takers and never takers ignore it, defiers do the opposite. The as-treated comparison is confounded by who chooses treatment. The assignment effect (intention to treat) divided by the change in uptake it causes, the Wald estimator, recovers the effect on compliers, provided there are no defiers, the instrument is not weak and it acts only through treatment. Break each condition and watch what happens.
Each unit has a type, a randomly assigned Z (probability 1/2), treatment A (compliers A = Z, always takers 1, never takers 0, defiers 1 − Z) and outcome Y = baseline + effect × A + direct × Z + noise. The baseline is +selection for always takers, −selection for never takers and 0 otherwise, so the people who choose treatment differ from those who do not. The effect is the compliers’ for compliers and “others” for everybody else. If the shares sum to more than 1 they are scaled down. Standard errors: Welch for the two contrasts, the delta method on the influence functions for the Wald ratio. Faint bars after “Repeat” are the 5th to 95th percentile over 300 samples; the white tick is the mean.
code/ch36_causality.py (iv_types, wald, wald_limit, tsls).