This function computes multiply robust estimates of interventional mediation effects with two mediators. Two such estimates are produced, an augmented inverse probability of treatment weighted (AIPTW) estimator and a targeted minimum loss estimator (TMLE). The AIPTW was found to perform better in most simulations.
intermed( Y, C, M1, M2, A, DeltaA = as.numeric(!is.na(A)), DeltaM = as.numeric(!is.na(M1)), a = 1, a_star = 0, SL_Qbar = NULL, SL_g = NULL, SL_Q_M = NULL, n_SL = 1, glm_Qbar = NULL, glm_g = NULL, glm_Q_M = NULL, tolg = 0.01, tol = 1/(sqrt(length(Y)) * log(length(Y))), targeted_se = FALSE, return_models = FALSE, cvFolds = 1, use_future = FALSE, Qbar_n = NULL, Q_M_n = NULL, gn = NULL, max_iter = 50, verbose = FALSE, stratify = FALSE, ... )
Y | A vector of continuous or binary outcomes. |
---|---|
C | A |
M1 | A |
M2 | A |
A | A vector of binary treatment assignment (assumed to be equal to 0 or 1). |
DeltaA | Indicator of missing treatment (assumed to be equal to 0 if missing 1 if observed). |
DeltaM | Indicator of missing outcome (assumed to be equal to 0 if missing 1 if observed). |
a | The label for the treatment. The effects estimates returned pertain
to estimation of interventional effects of |
a_star | The label for the treatment. The effects estimates returned pertain
to estimation of interventional effects of |
SL_Qbar | A vector of characters or a list describing the Super Learner library to be used for the outcome regression. |
SL_g | A vector of characters or a list describing the Super Learner library to be used for the propensity score. |
SL_Q_M | A list with two named entries |
n_SL | The number of repeated super learner runs to execute for each regression. |
glm_Qbar | A character describing a formula to be used in the call to
|
glm_g | A character describing a formula to be used in the call to
|
glm_Q_M | A list with two named entries |
tolg | The truncation level for the propensity score |
tol | The tolerance for stopping the iterative targeting procedure. |
targeted_se | A boolean indicating whether to return the standard error estimates based on targeted nuisance parameters or the initial estimates of nuisance parameters. |
return_models | A boolean indicating whether to return the fitted models for
each of the nuisance regressions. If |
cvFolds | Number of cross-validation folds to use if CVTMLE and CV-one step are desired |
use_future | A boolean indicating whether to use the |
Qbar_n | Power users may wish to pass in their own properly formatted list of the
outcome regression so that
nuisance parameters can be fitted outside of |
Q_M_n | Power users may wish to pass in their own properly formatted list of the
mediator distributions so that nuisance parameters can be fitted outside
of |
gn | Power users may wish to pass in their own properly formatted list of the
propensity score so that
nuisance parameters can be fitted outside of |
max_iter | The maximum number of iterations for the TMLE |
verbose | A boolean indicating whether to print status updates. |
all_mediator_values | All combinations of M1 and M2 |
An object of class "intermed"
.
aiptw
A list
of point estimates and
estimated covariance matrix from the one-step estimator
tmle
A list
of point estimates and
estimated covariance matrix from the TMLE
plugin
Plugin estimates of the mediation effects
fm
Fitted models if return_models = TRUE
, NULL
otherwise
Under the hood, the function fits several nuisance regressions and combines them
into the final estimate. Users have several options for fitting these regressions
as described below. In particular, SuperLearner
can be used to flexibly
estimate the regressions.