Skip to contents

The four-way decomposition shows that mediation analysis and interaction analysis are two halves of one accounting identity: a total effect divides into a part due to neither, a part due to interaction alone, a part due to mediation alone, and a part that needs both at once. The fourth piece is the one neither literature could name on its own.

Usage

Intmd4(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

Exposure contrast levels.

m

Level the mediator is controlled at for the CDE.

Value

List with estimate, cde, intref, intmed, pie, pai, pe, theta, beta, n.

Details

Formula: TE = CDE + INTref + INTmed + PIE from \(Y = th0 + th1 a + th2 m + th3 a m + th4'c\) and \(M = b0 + b1 a + b2'c\).

References

VanderWeele, T. J. (2014). A unification of mediation and interaction: a 4-way decomposition. Epidemiology 25:749-761.

Examples

Intmd4(X = 5L, M = 5L, Y = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0
#> 
#> $cde
#> [1] 0
#> 
#> $intref
#> [1] 0
#> 
#> $intmed
#> [1] 0
#> 
#> $pie
#> [1] 0
#> 
#> $pai
#> [1] 0
#> 
#> $pe
#> [1] 0
#> 
#> $theta
#> [1] 1 0 0 0
#> 
#> $beta
#> [1] 5 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "VanderWeele four-way decomposition"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"