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,
  ...
)

Arguments

Y

A vector of continuous or binary outcomes.

C

A data.frame of named covariates.

M1

A vector of mediators.

M2

A vector of mediators.

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 versus a_star.

a_star

The label for the treatment. The effects estimates returned pertain to estimation of interventional effects of a versus a_star.

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 M1 and M2, specifying super learner libraries for estimation of the pooled hazard regression that is mapped into an estimate of the mediator distributions.

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 for the outcome regression. The formula may include colnames(C), "A" (if stratify = FALSE), "M1", and "M2" as terms in the formula.

glm_g

A character describing a formula to be used in the call to glm for the outcome regression. The formula may include colnames(C), in the formula.

glm_Q_M

A list with two named entries M1 and M2, specifying the regression formula for estimation of the pooled hazard regression that is mapped into an estimate of the mediator distributions. The formula for M1 can include "A" (if stratify = FALSE) and colnames(C), while the formula for M2 can additionally include M1.

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 TRUE then the output will include a list with named entries g (propensity score fit), Qbar (outcome regression fit), and Q_M (mediator distribution fits).

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 future package to parallelize computations

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 intermed.

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 intermed.

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 intermed.

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

Value

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

Details

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.