Nonparametric estimation of the population intervention (in)direct effects

medshift(W, A, Z, Y, ids = seq_along(Y), delta,
g_learners = sl3::Lrnr_glm$new(), e_learners = sl3::Lrnr_glm$new(),
m_learners = sl3::Lrnr_glm$new(), phi_learners = sl3::Lrnr_glm$new(),
estimator = c("onestep", "tmle", "substitution", "reweighted"),
estimator_args = list(cv_folds = 10, max_iter = 10000, step_size = 1e-06))

## Arguments

W |
A `matrix` , `data.frame` , or similar corresponding to a
set of baseline covariates. |

A |
A `numeric` vector corresponding to a treatment variable. The
parameter of interest is defined as a location shift of this quantity. |

Z |
A `numeric` vector, `matrix` , `data.frame` , or
similar corresponding to a set of mediators (on the causal pathway between
the intervention A and the outcome Y). |

Y |
A `numeric` vector corresponding to an outcome variable. |

ids |
A `numeric` vector of observation-level IDs, allowing for
observational units to be related through a hierarchical structure. The
default is to assume all units are IID. When repeated IDs are included,
both the cross-validation procedures used for estimation and inferential
procedures respect these IDs. |

delta |
A `numeric` value indicating the degree of shift in the
intervention to be used in defining the causal quantity of interest. In the
case of binary interventions, this takes the form of an incremental
propensity score shift, acting as a multiplier of the odds with which a
unit receives the intervention (EH Kennedy, 2018, JASA;
doi:10.1080/01621459.2017.1422737). |

g_learners |
A `Stack` (or other learner class that
inherits from `Lrnr_base` ), containing a single or set of
instantiated learners from sl3, to be used in fitting the propensity
score, i.e., g = P(A | W). |

e_learners |
A `Stack` (or other learner class that
inherits from `Lrnr_base` ), containing a single or set of
instantiated learners from sl3, to be used in fitting a propensity
score that conditions on the mediators, i.e., e = P(A | Z, W). |

m_learners |
A `Stack` (or other learner class that
inherits from `Lrnr_base` ), containing a single or set of
instantiated learners from sl3, to be used in fitting the outcome
regression, i.e., m(A, Z, W). |

phi_learners |
A `Stack` (or other learner class that
inherits from `Lrnr_base` ), containing a single or set of
instantiated learners from sl3, to be used in a regression of a
pseudo-outcome on the baseline covariates, i.e.,
phi(W) = E[m(A = 1, Z, W) - m(A = 0, Z, W) | W). |

estimator |
The desired estimator of the natural direct effect to be
computed. Currently, choices are limited to a substitution estimator, a
re-weighted estimator, a one-step estimator, and a targeted minimum loss
estimator. |

estimator_args |
A `list` of extra arguments to be passed (via
`...` ) to the function call for the specified estimator. The default
is so chosen as to allow the number of folds used in computing the one-step
estimator to be easily tweaked. Refer to the documentation for functions
`est_onestep` , `est_ipw` , and
`est_substitution` for details on what other arguments may be
specified through this mechanism. For the option `"tmle"` , there is
heavy reliance on the architecture provided by tmle3. |