balanceTable: Create Balance Table

View source: R/balanceTable.R

balanceTableR Documentation

Create Balance Table

Description

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.

Usage

balanceTable(
  df.orig,
  df.match = NULL,
  treatment,
  school.id = NULL,
  var.names = NULL,
  include.tests = FALSE,
  verbose = FALSE
)

Arguments

df.orig

a data frame containing the data before matching

df.match

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

treatment

name of the binary indicator for treatment status

school.id

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

var.names

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

include.tests

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

verbose

a logical value indicating whether detailed output should be printed.

Details

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).

Value

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.

References

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.