Each subject has two potential outcomes, C0 (untreated) and C1 (treated), and we observe only Y = CX. With binary outcomes there are four types of subject: survivors (1, 1), responders (0, 1), anti-responders (1, 0) and the doomed (0, 0). The causal effect θ = E(C1) − E(C0) is the share of responders minus the share of anti-responders. The association α = E(Y | X = 1) − E(Y | X = 0) compares two different groups of people. Panel (a) shows who ends up in each group, panel (b) moves from random assignment (λ = 0) to the chosen self-selection (λ = 1), and panel (c) shows what the difference in sample means estimates.
survivors (1, 1)
responders (0, 1)
anti-responders (1, 0)
doomed (0, 0)
survivors
responders
anti-responders
doomed
With λ between 0 and 1 each type is treated with probability (1 − λ)·P(X = 1) + λ·(its slider), which keeps the share of treated subjects fixed. Each simulated study draws n subjects (type, then treatment) with the seeded generator; studies in which an arm is empty are left out of the histogram.
code/ch16_causal_inference.py (type_model, mix_assignment, types_sim; Figure 16.S1).