balance: Returns a summary of the balance for all bootstrap samples.

View source: R/balance.R

balanceR Documentation

Returns a summary of the balance for all bootstrap samples.

Description

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


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)
bm.usa.bal <- balance(bm.usa)



PSAboot documentation built on Oct. 24, 2023, 1:06 a.m.