ps.xgb {twangRDC}R Documentation

Gradient boosted propensity score estimation

Description

ps.xgb calculates propensity scores using gradient boosted logistic regression and diagnoses the resulting propensity scores using a variety of methods

Usage

ps.xgb(
  formula = formula(data),
  strata = NULL,
  data,
  params,
  file = NULL,
  max.steps = Inf,
  iters.per.step = 100,
  id.var,
  min.iter = 1000,
  min.width = NULL,
  verbose = TRUE,
  save.model = FALSE,
  weights = NULL,
  linkage = TRUE
)

Arguments

formula

An object of class formula: a symbolic description of the propensity score model to be fit with the treatment indicator on the left side of the formula and the variables to be balanced on the right side.

strata

An optional factor variable identifying the strata. If specified, balance is optimized within strata.

data

A dataset.

params

xgboost parameters.

file

An optional character string naming a file to save intermediate results.

max.steps

An integer specifying the maximum number of steps to take. Note that max.steps*iters.per.step must be greater than or equal to min.iter. Default: Inf.

iters.per.step

An integer specifying the number of iterations to add to the model at each step of algorithm. Note that max.steps*iters.per.step must be greater than or equal to min.iter. Default: 100.

id.var

A variable that uniquely identifies observations.

min.iter

An integer specifying the minimum number of iterations before checking for convergence. Note that max.steps*iters.per.step must be greater than or equal to min.iter. Default: 1000.

min.width

An integer specifying the minimum number of iterations between the current number of iterations and the optimal value. Default: 5*iters.per.step.

verbose

A logical value indicating if the function should update the user on its progres Default: TRUE.

save.model

A logical value indicating if the xgboost model be saved as part of the output object. Default: FALSE.

weights

An optional variable that identifies user defined weights to be incorporated into the optimization.

linkage

An indicator of whether the weighting should be for linkage failure (or nonresponse) versus comparison group construction. A value of TRUE requests weighting to account for linkage failure, while a value of FALSE requests weighting for comparison group construction. Default: TRUE.

Value

Returns an object of class ps.xgb, a list containing

References

Dan McCaffrey, G. Ridgeway, Andrew Morral (2004). "Propensity Score Estimation with Boosted Regression for Evaluating Adolescent Substance Abuse Treatment", Psychological Methods 9(4):403-425.

See Also

twang::ps, xgboost

Examples

# See the vignette for examples.



[Package twangRDC version 1.0 Index]