
Controlled direct effect: the treatment effect with the mediator fixed
Source:R/tmlcde.R
Tmlecde.RdThe clever covariate carries BOTH nuisance densities in its
denominator, so positivity is far more demanding than for a total
effect; min_denominator exists for that reason.
Arguments
- Y
Outcome in [0, 1].
- A
Binary treatment.
- M
Mediator level of each observation.
- QAM
Initial E[Y | A, M, W] at the observed (A, M).
- Q1m, Q0m
Initial E[Y | A = 1/0, M = m, W].
- g1W
Initial P(A = 1 | W).
- hmW
Initial P(M = m | A, W).
- m
The level the mediator is set to.
- gbound
Truncation on both nuisance probabilities.
- level
Confidence level.
Value
List with estimate, se, ci_lower,
ci_upper, mu1, mu0, epsilon,
min_denominator, max_weight, n.
References
van der Laan & Petersen (2008), International Journal of Biostatistics 4(1), Article 23 – the row's own citation. That paper was NOT obtainable, so the estimator is assembled from the components verified in the CRAN package tmle 2.1.1 (Gruber & van der Laan), with the clever covariate's denominator extended from g_a(W) to g_a(W) h_m(A, W) as the CDE identification requires.
Examples
set.seed(1)
n <- 400
A <- rbinom(n, 1, 0.5); M <- rbinom(n, 1, 0.3 + 0.3 * A)
Y <- rbinom(n, 1, plogis(-0.5 + 0.8 * A + 0.6 * M))
p <- function(a, m) plogis(-0.5 + 0.8 * a + 0.6 * m)
pm <- function(a) 0.3 + 0.3 * a
r <- Tmlecde(Y, A, M, QAM = p(A, M), Q1m = rep(p(1, 1), n), Q0m = rep(p(0, 1), n),
g1W = rep(0.5, n), hmW = ifelse(M == 1, pm(A), 1 - pm(A)), m = 1)
c(r$estimate, p(1, 1) - p(0, 1))
#> [1] 0.07709842 0.18597032