R/fit_mechanisms.R
fit_e_mech.RdFit propensity score regression while conditioning on mediators
fit_e_mech(data, valid_data = NULL, learners, z_names, w_names)A data.table containing the observed data, with columns
in the order specified by the NPSEM (Y, Z, A, W), with column names set
appropriately based on the original input data. Such a structure is merely
a convenience utility to passing data around to the various core estimation
routines and is automatically generated by medshift.
A holdout data set, with columns exactly matching those
appearing in the preceding argument data, to be used for estimation
via cross-fitting. Optional, defaulting to NULL.
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).
A character vector of the names of the columns that
correspond to mediators (Z). The input for this argument is automatically
generated by medshift.
A character vector of the names of the columns that
correspond to baseline covariates (W). The input for this argument is
automatically generated by a call to the wrapper function medshift.