Skip to contents

Each mediator is regressed on the exposure, M_k = alpha_0k + a_k X + ..., and the outcome on the exposure and ALL mediators at once, \(Y = beta_0 + c' X + sum_k b_k M_k + ...\). The specific indirect effect through mediator k is a_k b_k and the joint indirect effect is sum_k a_k b_k.

Usage

MultM(Y, X, M_list, C = NULL)

Arguments

Y

Outcome, length n.

X

Exposure, length n.

M_list

Mediators, n by k.

C

Optional baseline covariates.

Value

List with indirect (per mediator), indirect_total, direct, total, a, b, k, n.

Details

Fitting the mediators one at a time and the outcome on all of them is what makes these "parallel": no mediator is allowed to cause another. Daniel et al. (2015) is the reference for what that assumption buys and costs – with mediator-mediator causation the a_k b_k products are no longer the natural indirect effects and the sum no longer decomposes the total effect. This routine computes the parallel-model quantities; it does not test the assumption.

References

Daniel, De Stavola, Cousens and Vansteelandt (2015), Biometrics 71(1), 1-14, doi:10.1111/biom.12248 , verified against Crossref; VanderWeele (2015), Explanation in Causal Inference, OUP, ch. 5. Neither source was in the local corpus; the parallel-mediator products above are the standard published form.

Examples

MultM(Y = c(1, 2, 3, 4, 5, 6, 7, 8), X = c(1, 2, 3, 4, 5, 6, 7, 8),
  M_list = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $indirect
#> [1] 0.5
#> 
#> $indirect_total
#> [1] 0.5
#> 
#> $direct
#> [1] 0.5
#> 
#> $total
#> [1] 1
#> 
#> $a
#> [1] 1
#> 
#> $b
#> [1] 0.5
#> 
#> $k
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Parallel multiple mediators (specific and joint NIE)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"