Estimate the Outcome Mechanism
Arguments
- Y
A
numericvector of observed outcomes.- C_cens
A
numericvector of loss to follow-up indicators.- A
A
numericvector of observed exposure values.- W
A
numericmatrix of observed baseline covariate values.- delta
A
numericindicating the magnitude of the shift to be computed for the exposureA. This is passed to the internalshift_additiveand is currently limited to additive shifts.- samp_weights
A
numericvector of observation-level sampling weights, as produced by the internal procedure to estimate the two-phase sampling mechanismest_samp.- fit_type
A
characterindicating whether to use GLMs or Super Learner to fit the outcome regression. If the option "glm" is selected, the argumentglm_formulamust NOT beNULL, instead containing a model formula (as perglm) as acharacter. If the option "sl" is selected, the argumentsl_learnersmust NOT beNULL; instead, an instantiated sl3Lrnr_slobject, specifying learners and a metalearner for the Super Learner fit, must be provided. Consult the documentation of sl3 for details.- glm_formula
A
charactergiving aformulafor fitting a (generalized) linear model viaglm.- sl_learners
Object containing a set of instantiated learners from the sl3, to be used in fitting an ensemble model.
- scale_outcome
A
logicalindicating whether the outcome should be scaled to the unit interval before estimating the outcome regression (the default). IfFALSE, the outcome regression is estimated on the original scale of the outcome (e.g., for count outcomes, with learners that require non-negative integers), and its predictions are then scaled to the unit interval, as required by the targeting step. WhenFALSE, GLM-based fits use a Gaussian family; other working models (e.g., Poisson) may be specified viasl_learners.