Generate a table using the information collected in rand_pvals().
See rand_pvals() for more details about the methods used.
table_rand_pvals(
object = NULL,
z = NULL,
X = NULL,
base_strata = NULL,
refined_strata = NULL,
options = list()
)Matrix with 4 or 8 columns, depending whether one or both of base and
refined strata are provided and the incl_base option.
The columns give the observed standardized mean difference or objective value,
the median and maximum across nrand null simulations, and the P-value which is the
proportion of the null simulations that have worse covariate balance than the observed value.
The top three rows give the scaled objective value and the average and maximum standardized mean differences across
all strata and covariates. The following rows, one for each covariate, give the standardized mean difference
for that covariate, averaged across strata. The first row for the scaled objective value is NULL for the base
stratification, if included, as the base stratification does not generally minimize a mathematical objective function.
an optional object of class strat,
typically created using strat()
or as a result of a call to prop_strat() or refine().
If not provided, z and X must be specified
vector of treatment assignment; only used if object is not supplied
covariate matrix/data.frame; only used if object is not supplied
optional initial stratification for which to calculate
the empirical randomization null distribution;
only used if object is not supplied
optional refined stratification for which to calculate
the empirical randomization null distribution;
only used if object is not supplied
list of additional options, listed in the details below
The options list argument can contain any of the following elements:
how many times to randomize the treatment assignment when forming the null distribution. Default is 10000
which optimization criterion to use when calculating the objective value. Options are "max", "sum", or "combo", referring to whether to include the maximum standardized mean difference (SMD), the sum of all SMDs, or a combination of the maximum and the sum. The default is "combo"
how much to weight the maximum standardized mean difference compared to the sum. Only used if criterion is set to "combo". Default is 5
whether to include columns for the initial stratification in the table.
Default is TRUE if a base stratification is provided
if already calculated, the returned list of information from rand_pvals().
If NULL, this will be calculated