Skip to contents

Not the same as the proportion mediated even when it prints the same number: here the total is whatever the caller estimated, which need not equal NIE + NDE when the two came from different models. The implied direct effect is returned so the gap is visible.

Usage

Pmedex(nie, te)

Arguments

nie

Natural indirect effect.

te

Total effect, estimated separately.

Value

List with estimate, implied_nde, te.

Details

Formula: PTE = NIE / TE.

References

VanderWeele, T. J. (2013). Epidemiology 24:175-176.

Examples

Pmedex(nie = c(1, 2, 3, 4, 5, 6, 7, 8), te = 5L)
#> $estimate
#> [1] 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6
#> 
#> $implied_nde
#> [1]  4  3  2  1  0 -1 -2 -3
#> 
#> $te
#> [1] 5
#> 
#> $method
#> [1] "Proportion of the total effect explained"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"