E[Y(a)] = E[E[Y | A = a, L]], with an OLS outcome model including
treatment-covariate interactions. Mirrors morie.fn.causmrop.
Examples
set.seed(1)
n <- 3000
x <- stats::rnorm(n)
e <- pmin(pmax(1/(1 + exp(-x)), 0.05), 0.95)
tr <- as.numeric(stats::runif(n) < e)
y <- x + stats::rnorm(n) + 3 * tr
L <- stats::rnorm(n)
a <- as.numeric(stats::runif(n) < 1/(1 + exp(-1.5 * L)))
morie_g_formula(y, a, L)
#> $EY1
#> [1] 1.46452
#>
#> $EY0
#> [1] 1.413564
#>
#> $ate
#> [1] 0.05095646
#>
#> $n
#> [1] 3000
#>
