Skip to contents

TE = NDE + NIE is where mediation analysis usually stops. Each half still contains an interaction term, and separating them says whether the direct path carries an interaction with the mediator and whether the indirect path does. The pure indirect effect is the piece that would survive even if exposure and mediator never interacted.

Usage

Causmnde(X, M, Y, Cc = NULL, a = 1, astar = 0, m = 0)

Arguments

X

Exposure.

M

Mediator.

Y

Outcome.

Cc

Optional covariates; read at their means.

a, astar, m

Exposure contrast and controlled mediator level.

Value

List with NDE, NIE, PDE, PIE, estimate, cde, intref, intmed, n.

Details

Formula: NDE = CDE + INTref, NIE = PIE + INTmed, TE = NDE + NIE.

References

VanderWeele, T. J. (2015). Explanation in Causal Inference, Oxford University Press, chapter 14; VanderWeele (2014) Epidemiology 25:749-761.

Examples

Causmnde(X = 5L, M = 5L, Y = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $NDE
#> [1] 0
#> 
#> $NIE
#> [1] 0
#> 
#> $PDE
#> [1] 0
#> 
#> $PIE
#> [1] 0
#> 
#> $estimate
#> [1] 0
#> 
#> $cde
#> [1] 0
#> 
#> $intref
#> [1] 0
#> 
#> $intmed
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Natural effects with pure and interaction parts"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"