Learn R Programming

cobalt (version 1.3.0)

print.bal.tab: Print Results of a Call to bal.tab()

Description

Prints bal.tab() output in a clean way. Provides options for printing.

Usage

"print"(x, disp.m.threshold = "as.is", disp.v.threshold =  "as.is", un = "as.is", disp.means = "as.is", disp.v.ratio = "as.is", digits = max(3, getOption("digits") - 3), ...)
"print"(x, disp.r.threshold = "as.is", un = "as.is", digits = max(3, getOption("digits") - 3), ...)
"print"(x, disp.m.threshold = "as.is", disp.v.threshold =  "as.is", un = "as.is", disp.means = "as.is", disp.v.ratio = "as.is", disp.subclass = "as.is", digits = max(3, getOption("digits") - 3), ...)
"print"(x, disp.m.threshold = "as.is", disp.v.threshold =  "as.is", un = "as.is", disp.means = "as.is", disp.v.ratio = "as.is", which.cluster, cluster.summary = "as.is", cluster.fun = NULL, digits = max(3, getOption("digits") - 3), ...)
"print"(x, disp.r.threshold = "as.is", un = "as.is", which.cluster, cluster.summary = "as.is", cluster.fun = NULL, digits = max(3, getOption("digits") - 3), ...)

Arguments

x
a bal.tab object; the output of a call to bal.tab().
disp.m.threshold
whether to display output related to specifying m.threshold in the call to bal.tab(), which includes the Mean Difference Threshold column in the Balance table, the Mean Difference Balance Tally, and the variable with the Maximum Mean Difference Imbalance. Either FALSE or "as.is".
disp.v.threshold
whether to display output related to specifying v.threshold in the call to bal.tab(), which includes the Variance Ratio Threshold column in the Balance table, the Variance Ratio Balance Tally, and the variable with the Maximum Variance Ratio Imbalance. Either FALSE or "as.is".
un
whether to display balance values for the unadjusted sample. Ignored (and set to TRUE) if no conditioning was performed.
disp.means
whether to print the group means in balance output.
disp.v.ratio
whether to display variance ratios in balance output.
digits
the number of digits to display.
disp.r.threshold
whether to display output related to specifying r.threshold in the call to bal.tab() with a continuous treatment, which includes the Correlation Threshold column in the Balance table, the Correlation Balance Tally, and the variable with the Maximum Correlation Imbalance. Either FALSE or "as.is".
disp.subclass
whether to display balance information for individual subclasses if subclassification is used in conditioning.
which.cluster
which cluster(s) to display. If NULL, all clusters 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. To display the clusters requested in the original call to bal.tab(), omit this argument, as specifying "as.is" will request a cluster called "as.is.".
cluster.summary
whether to display the cluster summary table. If which.cluster is NULL, cluster.summary will be set to TRUE.
cluster.fun
a character vector of functions of balance statistics to display when dislaying balance across clusters. Can be "mean", "median", "min", or "max". More than one are allowed. "min" cannot be used if quick = TRUE in the original bal.tab() call.
...
further arguments passed to or from other methods.

Details

Simply calling bal.tab() will print its results, but it can be useful to store the results into an object and print them again later, possibly with different print options specified. The print() function automatically dispatches the correct method for the bal.tab object given. For balance tables generated from using weighting, matching, or no adjustement with a binary treatment, print.bal.tab() will be used. For balance tables generated from using weighting or no adjustment with a continuous treatment, print.bal.tab.cont() will be used. For balance tables generated from using weighting, matching, or no adjustement with a binary treatment and with clusters, print.bal.tab.cluster() will be used. For balance tables generated from using subclassification, print.bal.tab.subclass() will be used. For balance tables generated from using weighting or no adjustement with a continuous treatment, print.bal.tab.cont.cluster() will be used.

For all paramaters except disp.m.threshold, disp.v.threshold, disp.r.threshold, and which.cluster, either omitting the argument or setting it to "as.is" will use the corresponding print option stored in the bal.tab object, which results from the original call to bal.tab().

For disp.m.threshold, disp.v.threshold, and disp.r.threshold, setting the argument to FALSE will display the results as if the corresponding threshold value had been omitted or set to NULL in the original call to bal.tab(). If the original threshold was omitted or set to NULL, a new threshold cannot be set without a new call to bal.tab(), so TRUE is not an acceptable option here.

For which.cluster, to retain the display option of the original call to bal.tab(), the argument must omitted, as using "as.is" would cause print() to attempt to display balance for a cluster called "as.is". If such a cluster existed and it was desired, it would otherwise be impossible to display it.

Any paramater used in bal.tab() for calculations, such as int, addl, or distance, cannot be used with print(); only those parameters listed above, those that solely determine printing options, can be used. To change computation options, a new call to bal.tab() must be performed.

See Also

print, bal.tab

Examples

Run this code
## Not run: 
# ## Assuming x was generated with matchit(), ps(), or CBPS():
# b <- bal.tab(x, un = TRUE, v.threshold = 2)
# print(b, un = FALSE, disp.v.threshold = FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab