Skip to contents

$$CDE(m) = E[Y(1,m)] - E[Y(0,m)]$$ The mediator is set for everybody, not left where it would have fallen – that is what separates this from the natural direct effect. Under \(E[Y|X,M] = b_0 + b_X X + b_M M + b_{XM} XM\) the contrast is \(b_X + b_{XM} m\), so with no interaction it does not depend on m at all.

Usage

Cde(Y, X, M, m)

Arguments

Y

Outcomes.

X

Treatment, 0/1.

M

Mediator.

m

Value the mediator is set to.

Value

Named list with estimate, cde, intercept, beta_x, beta_m, interaction, se, m, n, method.

References

Robins & Greenland (1992) Epidemiology 3:143-155.

Examples

Cde(c(1, 2, 3, 4, 5, 6), c(0, 1, 0, 1, 0, 1), c(1, 1, 2, 2, 3, 3), 2)
#> $estimate
#> [1] 1
#> 
#> $cde
#> [1] 1
#> 
#> $intercept
#> [1] -1
#> 
#> $beta_x
#> [1] 1
#> 
#> $beta_m
#> [1] 2
#> 
#> $interaction
#> [1] 0
#> 
#> $se
#> [1] 0
#> 
#> $m
#> [1] 2
#> 
#> $n
#> [1] 6
#> 
#> $method
#> [1] "controlled direct effect (Robins & Greenland 1992)"
#>