Skip to contents

This method provides some crude overall measures of balance.

Usage

balance(psaboot, na.rm = TRUE, pool.fun = mean)

Arguments

psaboot

results from PSAboot.

na.rm

should NAs be removed. NAs generally occur when there is insufficient sample for a particular covariate or an unused level.

pool.fun

a function specifying how the effect sizes across all covariates should be combined. Possible values include mean (default), q25, q75, median, max, or any function that takes a vector of numeric values.

Value

a list with three elements:

unadjusted

named numeric vector with unadjusted effect size before adjustment for each covariate

complete

a matrix with adjusted effect size for each covariate (columns) for each method (rows).

pooled

a matrix with mean adjusted effect size for all covariates for each method (columns) and each bootstrap sample (rows).

balances

a list with an M x n covariates matrix for each method.

Examples

# \donttest{
library(PSAboot)
data(pisa.psa.cols)
data(pisausa)
bm.usa <- PSAboot(Tr = as.integer(pisausa$PUBPRIV) - 1,
    Y = pisausa$Math,
    X = pisausa[,pisa.psa.cols],
    control.ratio = 5, M = 100, seed = 2112)
#> 100 bootstrap samples using 6 methods.
#> Bootstrap sample sizes:
#>    Treated=345 (100%) with replacement.
#>    Control=4888 (35%) with replacement.
#> Warning: contrasts dropped from factor ST10Q01 due to missing levels
#> Warning: contrasts dropped from factor ST14Q01 due to missing levels
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: contrasts dropped from factor ST10Q01 due to missing levels
#> Warning: contrasts dropped from factor ST14Q01 due to missing levels
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: contrasts dropped from factor ST10Q01 due to missing levels
#> Warning: contrasts dropped from factor ST14Q01 due to missing levels
#> Warning: contrasts dropped from factor ST10Q01 due to missing levels
#> Warning: contrasts dropped from factor ST14Q01 due to missing levels
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> 
bm.usa.bal <- balance(bm.usa)

# }