Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bal.stat

Calculate weighted balance statistics


Description

'bal.stat' compares the treatment and control subjects by means, standard deviations, effect size, and KS statistics

Usage

bal.stat(
  data,
  vars = NULL,
  treat.var,
  w.all,
  sampw,
  get.means = TRUE,
  get.ks = TRUE,
  na.action = "level",
  estimand,
  multinom,
  fillNAs = FALSE
)

Arguments

data

A data frame containing the data

vars

A vector of character strings with the names of the variables on which the function will assess the balance

treat.var

The name of the treatment variable

w.all

Oobservation weights (e.g. propensity score weights, sampling weights, or both)

sampw

Sampling weights. These are passed in addition to 'w.all' because the "unweighted" results shoud be adjusted for sample weights (though not propensity score weights).

get.means

logical. If 'TRUE' then 'bal.stat' will compute means and variances

get.ks

logical. If 'TRUE' then 'bal.stat' will compute KS statistics

na.action

A character string indicating how 'bal.stat' should handle missing values. Current options are "level", "exclude", or "lowest"

estimand

Either "ATT" or "ATE"

multinom

logical. 'TRUE' if used for multinomial propensity scores.

fillNAs

logical. If 'TRUE', fills in zeros for missing values.

Details

'bal.stat' calls auxiliary functions for each variable and assembles the results in a table.

Value

'get.means' and 'get.ks' manipulate the inclusion of certain columns in the returned result.

References

Dan McCaffrey, G. Ridgeway, Andrew Morral (2004). "Propensity Score Estimation with Boosted Regression for Evaluating Adolescent Substance Abuse Treatment", *Psychological Methods* 9(4):403-425.

See Also

The example for [ps] contains an example of the use of [bal.table]


twang

Toolkit for Weighting and Analysis of Nonequivalent Groups

v2.0
GPL-3 | file LICENSE
Authors
Matthew Cefalu <Matthew_Cefalu@rand.org>, Greg Ridgeway, Dan McCaffrey, Andrew Morral, Beth Ann Griffin, and Lane Burgette
Initial release
2021-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.