2026-07-07



\[P(y|\text{do}(x)) = \sum_z P(y|x,z)P(z)\]
assume the following structural causal model (\(z\) is confounder, \(u\) is exogenous noise): \[f_y(t,z,u) = \beta_t t + \beta_z z + \beta_u u\]
then: \[\begin{align} \text{ATE} &= E[Y|\text{do}(t=1)] - E[Y|\text{do}(t=0)] \\ &\class{fragment}{= E_{z,u}[\beta_t * 1+ \beta_z z + \beta_u u] - E_{z,u}[\beta_t * 0 + \beta_z z + \beta_u u]} \\ &\class{fragment}{= \beta_t + E_{z,u}[\beta_z z + \beta_u u] - E_{z,u}[\beta_z z + \beta_u u]} \\ &\class{fragment}{= \beta_t} \end{align}\]
i.e. the ATE collapses to the the regression parameter \(\beta_t\) in a linear regression model of \(y\) on \(t,z\)
researchers make the following substantive assumption: the log-odds of the outcome is linear in the treatment and confounders: \[\text{logit}(P(y=1|t,z)) = \beta_0 + \beta_t t + \beta_z z\]
then the ATE is not equal to \(\beta_t\) anymore, but can be computed from the regression model: \[\begin{align} \text{ATE} &= E[Y|\text{do}(t=1)] - E[Y|\text{do}(t=0)] \\ &= E_z[P(y=1|t=1,z)] - E_z[P(y=1|t=0,z)] \\ &= E_z[\text{logit}^{-1}(\beta_0 + \beta_t * 1 + \beta_z z)] - E_z[\text{logit}^{-1}(\beta_0 + \beta_t * 0 + \beta_z z)] \end{align}\]
after fitting a logistic regression model in R with glm, the ATE can be computed with the package marginaleffects (or margins)
\[e(w) = P(T=1|W=w)\]
\[\begin{align} \hat{\tau}_{DR} &= \frac{1}{n} \sum_{i=1}^n \left[ \frac{T_i Y_i}{\hat{e}(W_i)} - \frac{(1-T_i) Y_i}{1-\hat{e}(W_i)} + \hat{\mu_1}(W_i) - \hat{\mu_0}(W_i) \right] \end{align}\]

The number of possible DAGs grows super-exponentially in the number of nodes
| n_nodes | n_dags | time at 1 sec / DAG |
|---|---|---|
| 1 | 1 | |
| 2 | 3 | |
| 3 | 25 | |
| 4 | 543 | |
| 5 | 29281 | > an hour |
| 6 | 3781503 | > a day |
| 7 | 1138779265 | > a year |
| 8 | 783702329343 | |
| 9 | 1213442454842881 | > human species |
| 10 | 4175098976430598143 | > age of universe |

Wouter van Amsterdam — WvanAmsterdam — vanamsterdam.github.io