Skip to contents

The absolute components answer how much; the proportions answer how much of what happened. They only make sense when the components point the same way – with mixed signs a share can exceed one or go negative – so sign agreement is checked and reported.

Usage

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

Arguments

Y

Outcome.

X

Exposure.

M

Mediator.

Cc

Optional covariates; read at their means.

a, astar, m

Exposure contrast and controlled mediator level.

Value

List with estimate, p_cde, p_intref, p_intmed, p_pie, p_mediated, p_interaction, te, same_sign, n.

Details

Formula: TE = CDE + INTref + INTmed + PIE, reported as each component over E[TE].

References

VanderWeele, T. J. (2014). Epidemiology 25:749-761.

Examples

VandIE(Y = c(1, 2, 3, 4, 5, 6, 7, 8), X = 5L, M = 5L)
#> $estimate
#> [1] NaN
#> 
#> $p_cde
#> [1] NaN
#> 
#> $p_intref
#> [1] NaN
#> 
#> $p_intmed
#> [1] NaN
#> 
#> $p_pie
#> [1] NaN
#> 
#> $p_mediated
#> [1] NaN
#> 
#> $p_interaction
#> [1] NaN
#> 
#> $te
#> [1] 0
#> 
#> $same_sign
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "VanderWeele four-way decomposition, proportions"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"