balanceTable: Create Balance Table

View source: R/balanceTable.R

balanceTableR Documentation

Create Balance Table


Given an unmatched sample of treated and control units and (optionally) a matched sample from the same data, produces a table with pre- and post-match measures of covariate balance.


  df.match = NULL,
  treatment, = NULL,
  var.names = NULL,
  include.tests = FALSE,
  verbose = FALSE



a data frame containing the data before matching


an optional data frame containing the matched sample. Must have all variable names to be balanced.


name of the binary indicator for treatment status

Identifier for groups (for example schools); need to pass if p-values for balance statistics are desired.


List of variable names to calculate balance for. If NULL, use all variables found in the df.orig data.frame.


Include tests of imbalance on covariates (TRUE/FALSE).


a logical value indicating whether detailed output should be printed.


This table can also include p-values for tests of whether the balance is statistically significant. These tests assume randomization at the cluster level. We recommend looking at the standardized differences rather than p-values to assess severity of imbalance, however.

The two tests, for each covariate are (1) Aggregation, where the covariates are averaged by each cluster, followed by a heteroskedastic robust t-test on the coefficient of a regression of these averages onto treatment (and intercept) and (2) cluster robust standard errors for the coefficient of treatment on a regression of covariate onto treatment (and intercept).


A data.frame of balance measures, with one row for each covariate in df.orig except treatment, and columns for treated and control means, standardized differences in means, p-values from two types of regression for difference in the groups. See description for further details. If df.match is specified there are twice as many columns, one set for the pre-match samples and one set for the post-match samples.


Rosenbaum, Paul R. (2002). Observational Studies. Springer-Verlag.

Rosenbaum, Paul R. (2010). Design of Observational Studies. Springer-Verlag.

matchMulti documentation built on March 27, 2022, 5:05 p.m.