CBPS objects from the CBPS package.
"bal.tab"(x, estimand, int = FALSE,  addl = NULL, continuous = c("std", "raw"),  binary = c("raw", "std"), s.d.denom,  m.threshold = NULL, v.threshold = NULL,  r.threshold = NULL, un = FALSE,  disp.means = FALSE, disp.v.ratio = FALSE,  cluster = NULL, which.cluster = NULL,  cluster.summary = TRUE, quick = FALSE, ...)CBPS object; the output of a call to CBPS() from the CBPS package.
s.d.denom if not specified. bal.tab() will determine this automatically if unstandardized weights were requested in the original call to CBPS(). This argument is only required if standardized weights were requested and if s.d.denom is left blank.
logical; whether or not to include 2-way interactions of covariates included in the call to CBPS() and in addl.
CBPS(). See note in Details.
bal.tab() will use "treated" if the estimand of the call to CBPS() (or that specified by the user to estimand) is the ATT and "pooled" if the estimand is the ATE.
logical; whether to print statistics for the unadjusted sample as well as for the adjusted sample.
logical; whether to print the group means in balance output.
logical; whether to display variance ratios in balance output.
NULL, all clusters in cluster will be displayed. If NA, no clusters will be displayed. Otherwise, can be a vector of cluster names or numerical indices for which to display balance. Indices correspond to the alphabetical order of cluster names. 
logical; whether to display the cluster summary table if cluster is specified. If which.cluster is NA, cluster.summary will be set to TRUE.
logical; if TRUE, will not compute any values that will not be displayed. Leave FALSE if computed values not displayed will be used later.
"bal.tab" containing balance summaries for the CBPS object. The following are the elements of bal.tab:If clusters are specified, an object of class "bal.tab.cluster" containing balance summaries within each cluster and a summary of balance across clusters. Each balance summary is a balance table as described in Balance above. The summary of balance across clusters displays the mean, median, and maximum mean difference and variance ratio after adjustment for each covariate across clusters. Minimum statistics are calculated as well, but not displayed. To see these, use the options in print.bal.tab.cluster.If treatment is continuous, means, mean differences, and variance ratios are replaced by (weighted) Pearson correlations between each covariate and treatment. The r.threshold argument works the same as m.threshold or v.threshold, adding an extra column to the balance table output and creating additional summaries for balance tallies and maximum imbalances. All arguments related to the calculation or display of mean differences or variance ratios are ignored. The int, addl, un, and cluster arguments are still used as described above.
bal.tab.CBPS generates a list of balance summaries for the CBPS object given, and functions similarly to balance() in CBPS.Several arguments of bal.tab() affect display only; they are passed directly to print.bal.tab, and do not affect any calculations or the contents of the bal.tab object. All balance statistics are calculated whether they are displayed by print or not. The threshold values (m.threshold, v.threshold), and r.threshold) control whether extra columns should be inserted into the Balance table describing whether the balance statistics in question exceeded or were within the threshold. Including these thresholds also creates summary tables tallying the number of variables that exceeded and were within the threshold and displaying the variables with the greatest imbalance on that balance measure.
The input to addl must be a data frame; if more than one variable is included, this is straightforward (i.e., because data[,c("v1", "v2")] is already a data frame), but if only one variable is used, R will coerce it to a vector, thus making it unfit for input here. To avoid this, simply wrap the input to addl in data.frame() or use subset() if only one variable is to be added. Again, when more than one variable is included, the input is general already a data frame and nothing needs to be done.
When standardized weights are requested in the call to CBPS(), variance ratios may not be computed, and if they are computed, they may not be accurate. For this reason, unstandardized weights are preferred. Mean differences, standardized or not, should be unaffected.
bal.tab for details of calculations.
library(CBPS); data("lalonde", package = "cobalt")
## Using CBPS() for generating covariate balancing propensity score weights
cbps.out <- CBPS(treat ~ age + educ + black + hispan + married + 
             nodegree + re74 + re75, data = lalonde, 
             standardize = FALSE)
bal.tab(cbps.out)
Run the code above in your browser using DataLab