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 |
iters.per.step |
An integer specifying the number of iterations to add
to the model at each step of algorithm. Note that |
id.var |
A variable that uniquely identifies observations. |
min.iter |
An integer specifying the minimum number of iterations before checking for convergence.
Note that |
min.width |
An integer specifying the minimum number of iterations between the current
number of iterations and the optimal value. Default: |
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
-
bal.tab
A table summarizing the balance at the optimal number of iterations. -
es
A table summarizing the standardized differences within strata at the optimal number of iterations. -
es.max
A table summarizing the maximum absolute standardized difference by strata. -
es.mean
A table summarizing the mean absolute standardized difference by strata. -
iter.per.step
Saves the value ofiters.per.step
specified by the user. -
opt.iter
The optimal number of iterations. -
strata
A list of the strata used in the optimization. -
weight.data
A dataset containing the unique ID and the optimal weight for each observation.
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
Examples
# See the vignette for examples.