$$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.
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)"
#>
