est_g: Estimate the Generalized Propensity Score (Treatment...

Description Usage Arguments Details Value

View source: R/fit_mechanisms.R

Description

Estimate the Generalized Propensity Score (Treatment Mechanism)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
est_g(
  A,
  W,
  delta = 0,
  ipc_weights = rep(1, length(A)),
  fit_type = c("sl", "hal"),
  sl_learners_density = NULL,
  haldensify_args = list(n_bins = c(5, 10), grid_type = c("equal_range", "equal_mass"),
    lambda_seq = exp(seq(-1, -13, length = 300)), use_future = FALSE)
)

Arguments

A

A numeric vector of observed treatment values.

W

A numeric matrix of observed baseline covariate values.

delta

A numeric value identifying a shift in the observed value of the treatment under which observations are to be evaluated.

ipc_weights

A numeric vector of observation-level weights, as produced by the internal procedure to estimate the censoring mechanism estimate-ipc_weights.

fit_type

A character specifying whether to use Super Learner (from sl3) or the Highly Adaptive Lasso (from hal9001) to estimate the conditional treatment density.

sl_learners_density

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

haldensify_args

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.

Details

Compute the propensity score (treatment mechanism) for the observed data, including the shift. This gives the propensity score for the observed data (at the observed A) and the shift (at A - delta).

Value

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 magitudie two (g(A + 2 delta) | W).


txshift documentation built on Oct. 23, 2020, 8:27 p.m.