dx.wts.mediation {twangMediation} | R Documentation |
Compute diagnostics assessing covariates balance.
Description
dx.wts.mediation
takes a ps
object or a set of propensity scores and
computes diagnostics assessing covariates balance.
Usage
dx.wts.mediation(
x,
data,
estimand,
vars = NULL,
treat.var,
x.as.weights = TRUE,
sampw = NULL,
perm.test.iters = 0
)
Arguments
x |
A data frame, matrix, or vector of propensity score weights or a ps
object. |
data |
A data frame. |
estimand |
The estimand of interest: either "ATT" or "ATE". |
vars |
A vector of character strings naming variables in |
treat.var |
A character string indicating which variable in |
x.as.weights |
|
sampw |
Optional sampling weights. If |
perm.test.iters |
A non-negative integer giving the number of iterations
of the permutation test for the KS statistic. If |
Details
Creates a balance table that compares unweighted and weighted means and standard deviations, computes effect sizes, and KS statistics to assess the ability of the propensity scores to balance the treatment and control groups.
Value
Returns a list containing
-
treat
The vector of 0/1 treatment assignment indicators.
See Also
wgtmed,bal.table.mediation,
print.mediation,summary.mediation
Examples
data("tMdat")
## tMdat is small simulated data set included in twangMediation for
## demonstrating the functions. See ?tMdat for details
fit.es.max <- wgtmed(M ~ w1 + w2 + w3,
data = tMdat,
a_treatment = "A",
y_outcome = "Y",
total_effect_wts = tMdat$te.wgt,
method = "ps",
ps_n.trees=1500,
ps_shrinkage=0.01,
ps_stop.method=c("es.max")
)
## dx.wts.mediation is used internally by bal.table.mediation,
## print.mediation, and summary.mediation
summary(fit.es.max)