cobalt-package: cobalt: Covariate Balance Tables and Plots

cobalt-packageR Documentation

cobalt: Covariate Balance Tables and Plots



A set of tools for assessing covariate balance in observational studies numerically and graphically. The functions provide integration with the major R packages used for balancing covariates, including MatchIt, WeightIt, twang, CBPS, and many others, and support objects not made using these packages. They support binary, multi-category and continuous treatments, point and longitudinal treatments, and clustered and multiply imputed data.

The main functions of cobalt are the following:

  • \fun - generate tables of balance statstics before and after matching, weighting, or subclassification

  • \fun

    bal.plot - generate plots to assess balance visually on one covariate at a time

  • \fun

    love.plot - generate plots to summarize and report balance statistics

Other functions include \funget.w for extracting weights from objects produced by other packages, \funcol_w_smd (and friends documentated on the same page) for computing (weighted) balance statistics outside of, and \funsplitfactor for splitting factor variables in a dataset into dummy variables.

cobalt has several vignettes, which can be accessed using vignette(package = "cobalt") or visiting the website at


Noah Greifer (ORCID)

To contact me about cobalt, please use the GitHub issues page.

cobalt documentation built on Nov. 4, 2022, 1:05 a.m.