Skip to contents

A path-specific effect sets the treatment to different values on different edges: mediators marked in path see A = 1, all other mediators see A = 0, and the outcome node sees A = 1; the contrast is against the all-zero regime. This is identified only when there is no recanting witness, which the caller asserts by supplying path – the function cannot check the graph for it.

Usage

Tmlpse(y, D, M_chain, X, path)

Arguments

y

Outcome.

D

Binary treatment.

M_chain

Mediators in causal order.

X

Baseline covariates.

path

1 if the treatment may act through that mediator.

Value

List with estimate, se, eps, n_path, n.

Details

Mediators are taken in column order as a causal chain, each modelled linearly on treatment, covariates and the mediators before it. The counterfactual mediator values are generated recursively at the path-assigned treatment values, so an upstream counterfactual feeds the downstream model. With every model linear the plug-in reduces to the product of coefficients along the selected paths, and its influence curve is the delta method on the stacked least-squares influence functions. No fluctuation is applied: the point-treatment clever covariate D/g - (1 - D)/(1 - g) solves the score of the total effect, not the path-specific one (eps is 0).

References

Miles, C. H. et al. (2017). JASA 112(520):1443-1452; Avin, C., Shpitser, I. & Pearl, J. (2005). IJCAI-05, 357-363.

Examples

set.seed(4)
n <- 300; X <- matrix(rnorm(n), n)
D <- rbinom(n, 1, 0.5)
M1 <- 0.5 * D + rnorm(n); M2 <- 0.3 * D + 0.2 * M1 + rnorm(n)
y <- D + M1 + M2 + X[, 1] + rnorm(n)
Tmlpse(y, D, M_chain = cbind(M1, M2), X = X, path = c(1, 0))$estimate
#> [1] 1.6296