Data-generating mechanism
P(Y=1 | X,Z) = p0 + dxX + dzZ
prevalence of the confounder
a1 ≠ a0 makes Z a confounder
Population risks
Where RDoverall comes from
RDoverall = dx + dz(q1 − q0), where qx = P(Z=1 | X=x). The second term is pure composition: it is non-zero only because the two exposure groups contain different proportions of Z=1.