Skip to contents

NDE = E[Y(1, M(0))] - E[Y(0, M(0))]. The contrast is delegated to Ndeff (module tmlnde); what this module adds is the step tmlnde deliberately refuses to take – producing the two cross-world quantities from data, which requires a model.

Usage

Nde(X, M, Y)

Arguments

X

Exposure.

M

Mediator.

Y

Outcome.

Value

List with estimate (NDE), se, nde, nie, total, mean_y10, mean_y00, b0, b1, c0, c1, c2, c3, n.

Details

The model is the standard two-equation linear SEM with an exposure-mediator interaction (VanderWeele 2015, eq. 2.9-2.11): M = b0 + b1 X + e_M and Y = c0 + c1 X + c2 M + c3 X M + e_Y. Under sequential ignorability E[M(0)] = b0, so E[Y(x, M(0))] = c0 + c1 x + c2 b0 + c3 x b0, NDE = c1 + c3 b0 and NIE = b1 (c2 + c3) contrasting x = 1 against x = 0. NDE + NIE is the total effect exactly. With no interaction the NDE collapses to the coefficient on X in the regression of Y on X and M.

No standard error is reported: the two cross-world means are point predictions from the fitted SEM, not a sample of contrasts.

References

Pearl (2001), Proc. 17th UAI, 411-420; VanderWeele (2015), Explanation in Causal Inference, OUP. Standard published form of the linear-SEM decomposition; neither source was in the local corpus, so the equations are stated in full above.

Examples

Nde(X = c(1, 2, 3, 4, 5, 6, 7, 8), M = c(1, 2, 3, 4, 5, 6, 7, 8), Y = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0.5
#> 
#> $se
#> [1] NaN
#> 
#> $nde
#> [1] 0.5
#> 
#> $nie
#> [1] 0.5
#> 
#> $total
#> [1] 1
#> 
#> $mean_y10
#> [1] 0.5
#> 
#> $mean_y00
#> [1] 6.250592e-16
#> 
#> $b0
#> [1] 6.097555e-16
#> 
#> $b1
#> [1] 1
#> 
#> $c0
#> [1] 3.201815e-16
#> 
#> $c1
#> [1] 0.5
#> 
#> $c2
#> [1] 0.5
#> 
#> $c3
#> [1] -4.597448e-17
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Natural direct effect (linear SEM, Pearl 2001)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"