Skip to contents

When a mediator-outcome confounder is itself affected by the exposure, the natural effects are not identified. The interventional analogues replace the unit's own counterfactual mediator with a draw from its population distribution given the exposure level, which is identified under weaker conditions but answers a population question rather than an individual one. Mirrors morie.fn.ipsiMed.

Usage

morie_interventional_effects(y, x, m, c = NULL, n_draws = 2000L, seed = 0L)

Arguments

y

Outcome.

x

Binary 0/1 exposure.

m

Mediator.

c

Optional baseline covariates.

n_draws

Monte Carlo draws of the randomised mediator.

seed

RNG seed.

Value

List with ide, iie, overall, n_draws, n.

References

VanderWeele TJ, Vansteelandt S, Robins JM (2014). Effect decomposition in the presence of an exposure-induced mediator-outcome confounder. Epidemiology 25(2), 300-306.

Examples

set.seed(5)
n <- 150
x <- rbinom(n, 1, 0.5)
m <- 0.5 * x + rnorm(n, 0, 0.5)
y <- 1 + 0.4 * x + 0.6 * m + rnorm(n, 0, 0.4)
r <- morie_interventional_effects(y, x, m, n_draws = 400L)
str(r, max.level = 1)
#> List of 5
#>  $ ide    : num 0.501
#>  $ iie    : num 0.306
#>  $ overall: num 0.807
#>  $ n_draws: int 400
#>  $ n      : int 150