estimate_mediator.Rd
Estimate the Mediator Mechanism
estimate_mediator(mediator, exposure, delta, mu_learner, covars, av, at)
A character
vector of mediator outcome
A character
vector of exposures to be shifted.
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.
Object containing a set of instantiated learners from the sl3, to be used in fitting an ensemble model.
A character
vector covariates to adjust for.
A dataframe
of validation data specific to the fold
A dataframe
of training data specific to the fold
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).
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).