Print Results of a Call to bal.tab()
Prints bal.tab()
output in a clean way. Provides options for printing.
## S3 method for class 'bal.tab' print(x, imbalanced.only, un, disp.bal.tab, disp.call, stats, disp.thresholds, disp, which.subclass, subclass.summary, which.imp, imp.summary, imp.fun, which.treat, multi.summary, which.time, msm.summary, which.cluster, cluster.summary, cluster.fun, digits = max(3, getOption("digits") - 3), ...)
x |
a |
imbalanced.only |
|
un |
|
disp.bal.tab |
|
disp.call |
|
stats |
|
disp.thresholds |
|
disp |
|
which.subclass |
when used with subclassification, which subclass(es) to display. If |
subclass.summary |
|
which.imp |
when used with multiply imputed data, which imputation(s) to display. If |
imp.summary |
|
imp.fun |
|
which.treat |
when used with multi-category treatments, which treatments to display. See |
multi.summary |
|
which.time |
when used with longitudinal treatments, which time periods to display if longitudinal treatments are used. See |
msm.summary |
|
which.cluster |
when used with clustered data, which cluster(s) to display. If |
cluster.summary |
|
cluster.fun |
|
digits |
the number of digits to display. |
... |
further arguments passed to or from other methods. |
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.
Any parameter 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.
Prior versions of print()
had separate methods for each bal.tab
class. Now they are dispatched internally.
Unless quick = FALSE
in the original call to bal.tab()
(which is not the default), some values may not be calculated, in which case using print()
will not display these values even when requested. For example, if stats = "m"
and quick = TRUE
in the original call to bal.tab()
(the default for both), setting stats = "ks"
in print()
will not print the KS statistics because they were not calculated.
Noah Greifer
display options for further information on some of these options.
library(WeightIt); data("lalonde", package = "cobalt") w.out <- weightit(treat ~ age + educ + married + race + re74 + re75, data = lalonde) b <- bal.tab(w.out, stats = c("m", "v", "ks"), un = TRUE, v.threshold = 2) print(b, un = FALSE, stats = c("m", "v"), disp.thresholds = c(v = FALSE))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.