table_rand_pvals {optrefine} | R Documentation |
Generate a covariate balance table from the empirical randomization null distribution
Description
Generate a table using the information collected in rand_pvals()
.
See rand_pvals()
for more details about the methods used.
Usage
table_rand_pvals(
object = NULL,
z = NULL,
X = NULL,
base_strata = NULL,
refined_strata = NULL,
options = list()
)
Arguments
object |
an optional object of class |
z |
vector of treatment assignment; only used if |
X |
covariate matrix/data.frame; only used if |
base_strata |
optional initial stratification for which to calculate
the empirical randomization null distribution;
only used if |
refined_strata |
optional refined stratification for which to calculate
the empirical randomization null distribution;
only used if |
options |
list of additional options, listed in the |
Details
The options
list argument can contain any of the following elements:
nrand: how many times to randomize the treatment assignment when forming the null distribution. Default is 10000
criterion: 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"
wMax: how much to weight the maximum standardized mean difference compared to the sum. Only used if criterion is set to "combo". Default is 5
incl_base: whether to include columns for the initial stratification in the table. Default is
TRUE
if a base stratification is providedrand_pvals: if already calculated, the returned list of information from
rand_pvals()
. IfNULL
, this will be calculated
Value
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.