Skip to contents

Plug-in estimator of the Pearl adjustment formula \(P(y | do(x)) = \sum_s P(y | x, s) P(s)\) (Pearl 2009, Statistics Surveys 3, Eq. 25, Section 3.3.1) for a binary treatment and a discrete admissible set: the ATE is the stratum-share weighted sum of within-stratum differences of arm means. The standard error treats stratum shares as fixed: \(Var = \sum_z (n_z/n)^2 (s_{1z}^2/n_{1z} + s_{0z}^2/n_{0z})\) with within-arm sample variances.

Usage

Causbckd(y, x, z)

Arguments

y

Outcome, length n.

x

Binary treatment, coded 0/1.

z

Discrete stratum labels of the admissible set.

Value

List with estimate, se, strata, n, method. A stratum with an empty arm is a positivity violation and raises an error.

References

Pearl, J. (2009), Causal inference in statistics: An overview, Statistics Surveys 3, 96-146, doi:10.1214/09-SS057, Eq. 25, Section 3.3.1.

Examples

set.seed(1)
Causbckd(y = rnorm(50), x = rbinom(50, 1, 0.5),
         z = sample(c("a", "b"), 50, replace = TRUE))
#> $estimate
#> [1] 0.3932984
#> 
#> $se
#> [1] 0.2330989
#> 
#> $strata
#> $strata$a
#> $strata$a$share
#> [1] 0.56
#> 
#> $strata$a$effect
#> [1] 0.2685035
#> 
#> $strata$a$n1
#> [1] 14
#> 
#> $strata$a$n0
#> [1] 14
#> 
#> 
#> $strata$b
#> $strata$b$share
#> [1] 0.44
#> 
#> $strata$b$effect
#> [1] 0.5521284
#> 
#> $strata$b$n1
#> [1] 12
#> 
#> $strata$b$n0
#> [1] 10
#> 
#> 
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "Pearl (2009) Eq. 25 backdoor adjustment, stratified plug-in"
#>