R/fit_mechanisms.R
est_g_exp.Rd
Estimate the Exposure Mechanism via Generalized Propensity Score
A numeric
vector of observed exposure values.
A numeric
matrix of observed baseline covariate values.
A numeric
value identifying a shift in the observed
value of the exposure under which observations are to be evaluated.
A numeric
vector of observation-level sampling
weights, as produced by the internal procedure to estimate the two-phase
sampling mechanism est_samp
.
A character
specifying whether to use Super Learner
(from sl3) or the Highly Adaptive Lasso (from hal9001) to
estimate the conditional exposure density.
Object containing a set of instantiated learners from sl3, to be used in fitting an ensemble model.
A list
of argument to be directly passed to
haldensify
when fit_type
is set to
"hal"
. Note that this invokes the Highly Adaptive Lasso instead of
Super Learner and is thus only feasible for relatively small data sets.
A data.table
with four columns, containing estimates of the
generalized propensity score at a downshift (g(A - delta | W)), no shift
(g(A | W)), an upshift (g(A + delta) | W), and an upshift of magnitude two
(g(A + 2 delta) | W).
Compute the propensity score (exposure mechanism) for the observed data, including the shift. This gives the propensity score for the observed data (at the observed A) the counterfactual shifted exposure levels at (A - delta), (A + delta), and (A + 2 * delta).