broom::tidy()
/glance()
methods for balanceTest()
resultsPortion out the value of a balanceTest()
call in a manner consistent
with assumptions of the broom package.
tidy.xbal(
x,
strata = dimnames(x[["results"]])[["strata"]][1],
varnames_crosswalk = c(z = "statistic", p = "p.value"),
format = FALSE,
digits = max(2, getOption("digits") - 4),
...
)glance.xbal(x, strata = dimnames(x[["results"]])[["strata"]][1], ...)
data frame composed of: for [RItools::tidy()]
, a column of variable labels (vars
) and
additional columns of balance-related stats; for [RItools::glance()]
, scalars describing
a combined differences test, if found, and otherwise NULL
.
object of class "xbal"
, result of balanceTest()
or xBalance()
which stratification to return info about? Defaults to last one specified in originating function call (which appears first in the xbal array).
character vector of new names for xbal columns, named by the xbal column
if true, apply [RItools:::original_units_var_formatter()]
to suitable sub-array en route
passed to [RItools:::original_units_var_formatter()]
Additional arguments passed to [RItools:::original_units_var_formatter()]
tidy.xbal()
gives per-variable
statistics whereas glance.xbal()
extracts combined-difference related
calculations. In both cases one has to specify which stratification one wants
statistics about, as xbal objects can store info about several stratifications.
tidy.xbal()
has a parameter varnames_crosswalk
not shared with
glance.xbal()
. It should be a named character vector, the elements
of which give names of columns to be returned and the names of which correspond
to columns of xbal objects' ‘results’ entry. Its ordering dictates the order
of the result. The default value translates between conventional xbal
column names and broom package conventional names.
variable name
mean of LHS variable = 0 group
mean of LHS variable = 1 group
T - C diff w/ direct standardization for strata if applicable
adj.diff/pooled.sd
pooled SD
z
column from the xbal object
p
column from the xbal object
Additional parameters beyond those listed here are ignored (at this time).