A formula for the propensity score model with the treatment
indicator on the left side of the formula and the potential
confounding variables on the right side.
data
The dataset, includes treatment assignment as well as covariates
n.trees
number of gbm iterations passed on to gbm
interaction.depth
interaction.depth passed on to
gbm
shrinkage
shrinkage passed on to gbm
bag.fraction
bag.fraction passed on to gbm
perm.test.iters
a non-negative integer giving the number of iterations
of the permutation test for the KS statistic. If perm.test.iters=0
then the function returns an analytic approximation to the p-value. Setting
perm.test.iters=200 will yield precision to within 3% if the true
p-value is 0.05. Use perm.test.iters=500 to be within 2%
print.level
the amount of detail to print to the screen
iterlim
maximum number of iterations for the direct optimization
verbose
if TRUE, lots of information will be printed to monitor the
the progress of the fitting
estimand
The causal effect of interest. Options are "ATE" (average treatment effect),
which attempts to estimate the change in the outcome if the treatment were applied to the entire population
versus if the control were applied to the entire population, or "ATT" (average treatment effect on
the treated) which attempts to estimate the analogous effect, averaging only over the treated population.
stop.method
A method or methods of measuring and summarizing balance across
pretreatment variables. Current options are ks.mean, ks.max, es.mean,
and es.max. ks refers to the
Kolmogorov-Smirnov statistic and es refers to standardized effect size. These are summarized
across the pretreatment variables by either the maximum (.max) or the mean (.mean).
sampw
Optional sampling weights.
multinom
Set to true only when called from mnps function.
...
Additional arguments.
Details
formula should be something like "treatment ~ X1 + X2 + X3". The
treatment variable should be a 0/1 indicator. There is no need to specify
interaction terms in the formula. interaction.depth controls the level
of interactions to allow in the propensity score model.
Note that — unlike earlier versions of twang — plotting functions
are no longer included in the ps() function. See
plot for details of the plots.
Value
Returns an object of class ps, a list containing
gbm.obj
The returned gbm object
treat
The treatment variable.
desc
a list containing balance tables for each method selected in
stop.methods. Includes a component for the unweighted
analysis names “unw”. Each desc component includes
a list with the following components
ess
The effective sample size of the control group
n.treat
The number of subjects in the treatment group
n.ctrl
The number of subjects in the control group
max.es
The largest effect size across the covariates
mean.es
The mean absolute effect size
max.ks
The largest KS statistic across the covariates
mean.ks
The average KS statistic across the covariates
bal.tab
a (potentially large) table summarizing the quality of the
weights for equalizing the distribution of features across
the two groups. This table is best extracted using the
bal.table method. See the help for
bal.table for details on the table's contents
n.trees
The estimated optimal number of gbm
iterations to optimize the loss function for the associated
stop.methods
ps
a data frame containing the estimated propensity scores. Each
column is associated with one of the methods selected in
stop.methods
w
a data frame containing the propensity score weights. Each
column is associated with one of the methods selected in
stop.methods. If sampling weights are given then these are
incorporated into these weights.
estimand
The estimand of interest (ATT or ATE).
datestamp
Records the date of the analysis
parameters
Saves the ps call
alerts
Text containing any warnings accumulated during the estimation
iters
A sequence of iterations used in the GBM fits used by plot function.
balance
The balance measures for the pretreatment covariates, with a column for each
stop.method.
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.