weighting: Estimate weights for generalizing ATE by predicting...

Description Usage Arguments

View source: R/weighting.R

Description

Estimate weights for generalizing ATE by predicting probability of trial participation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
weighting(
  outcome,
  treatment,
  trial,
  selection_covariates,
  data,
  selection_method = "lr",
  sl_library = NULL,
  survey_weights = FALSE,
  trim_weights = FALSE,
  trim_pctile = 0.97,
  is_data_disjoint = TRUE,
  seed
)

Arguments

outcome

variable name denoting outcome

treatment

variable name denoting binary treatment assignment (ok if only available in trial, not population)

trial

variable name denoting binary trial participation (1 = trial participant, 0 = not trial participant)

selection_covariates

vector of covariate names in data set that predict trial participation

data

data frame comprised of "stacked" trial and target population data

selection_method

method to estimate the probability of trial participation. Default is logistic regression ("lr"). Other methods supported are Random Forests ("rf"), Lasso ("lasso"), GBM ("gbm") and SuperLearner ("super").

sl_library

vector of SuperLearner library methods. If ‘selection_method' = ’super', specify names of methods to include in library. Default is NULL.

survey_weights

variable name of population data's complex survey weights. Default is FALSE: if FALSE, then population data do not come a complex survey and weights do not need to be incorporated in estimation. NOTE: SURVEY WEIGHTS ONLY SUPPORTED FOR USE WHEN USING WEIGHTING METHODS FOR THE TIME BEING. Survey weights will not be incorporated in BART or TMLE.

trim_weights

logical. If TRUE, then trim the weights to the value specified in 'trim_pctile'. Default is FALSE.

trim_pctile

numeric. If 'trim_weights' is TRUE, then specify what percentile weights should be trimmed to. Default is 0.97.

is_data_disjoint

logical. If TRUE, then trial and population data are considered independent. This affects calculation of the weights - see details for more information.

seed

numeric. By default, the seed is set to 13783, otherwise can be specified (such as for simulation purposes).


benjamin-ackerman/generalize documentation built on Oct. 11, 2020, 3:58 a.m.