\(P(Y=y | do(X=x)) = \sum_z P(Y=y | X=x, Z=z) P(Z=z)\). Each
stratum is reweighted by how common it is in the whole population,
not among the treated; that reweighting is the entire content of the
formula.
Usage
morie_backdoor_adjustment(x, y, z, at = NULL)
Arguments
- x, y
Discrete treatment and outcome vectors.
- z
Adjustment set: a vector or a matrix of columns.
- at
Treatment value to intervene on; defaults to every level.
Value
Named list with distribution, strata,
p_z, n, incomplete_strata, method.
Details
This is causal only when Z satisfies the back-door criterion, which
is a claim about the graph and cannot be checked from data. See
morie_backdoor_criterion. All variables are discrete.
Mirrors morie.fn.bdrj.
References
Pearl J (2009). Causality, 2nd edn, Thm 3.3.2.
Examples
morie_backdoor_adjustment(c(1, 1, 0, 0), c(1, 0, 1, 0), c(0, 0, 1, 1))$distribution
#> $`0`
#> 0 1
#> 0.25 0.25
#>
#> $`1`
#> 0 1
#> 0.25 0.25
#>