Estimate the Mediator Mechanism

estimate_mediator(mediator, exposure, delta, mu_learner, covars, av, at)

Arguments

mediator

A character vector of mediator outcome

exposure

A character vector of exposures to be shifted.

delta

A numeric indicating the magnitude of the shift to be computed for the exposure A. This is passed to the internal shift_additive and is currently limited to additive shifts.

mu_learner

Object containing a set of instantiated learners from the sl3, to be used in fitting an ensemble model.

covars

A character vector covariates to adjust for.

av

A dataframe of validation data specific to the fold

at

A dataframe of training data specific to the fold

Value

A data.table with two columns, containing estimates of the outcome mechanism at the natural value of the exposure Q(A, W) and an upshift of the exposure Q(A + delta, W).

Details

Compute the outcome regression for the observed data, including with the shift imposed by the intervention. This returns the mediator regression for the observed data (at A) and under the counterfactual shift shift (at A + delta).