# cem: Coarsened Exact Matching Software

Stefano M. Iacus Gary King, Giuseppe Porro
Version:1.0.137

A picture of the the original Columbus egg, a name now used to describe something which is simple or obvious only after it has been explained.

This program is designed to improve the estimation of causal effects via an extremely powerful method of matching that is widely applicable and exceptionally easy to understand and use (if you understand how to draw a histogram, you will understand this method). The program implements the Coarsened Exact Matching (CEM) algorithm described in

> Stefano M. Iacus, Gary King, and Giuseppe Porro, "Causal Inference Without Balance Checking: Coarsened Exact Matching" (Abstract: HTML | Paper: PDF) and "Multivariate Matching Methods That are Monotonic Imbalance Bounding" (Abstract: HTML | Paper: PDF).

Matching is a nonparametric method of preprocessing data to control for some or all of the potentially confounding influence of pretreatment control variables by reducing imbalance between the treated and control groups. After preprocessing in this way, any method of analysis that would have been used without matching can be applied to estimate causal effects, although some methods will have even better properties. CEM is a Monotonoic Imbalance Bounding (MIB) matching method --- which means that the balance between the treated and control groups is chosen by the user ex ante rather than discovered through the usual laborious process of checking after the fact and repeatedly reestimating, and so that adjusting the imbalance on one variable has no effect on the maximum imbalance of any other. CEM also strictly bounds through ex ante user choice both the degree of model dependence and the average treatment effect estimation error, eliminates the need for a separate procedure to restrict data to common empirical support, meets the congruence principle, is robust to measurement error, works well with multiple imputation methods for missing data, can be completely automated, and is extremely fast computationally even with very large data sets. After preprocessing data with CEM, the analyst may then use a simple difference in means or whatever statistical model they would have applied without matching. CEM also works well for multicategory treatments, determining blocks in experimental designs, and evaluating extreme counterfactuals.

- CEM Package for R:

- To install, sign on to R, and type: install.packages("cem",repos="http://gking.harvard.edu") or download this file and install yourself.
- For documentation, from R, type library(cem), and then ?cem, or download PDF (or the published Journal of Statistical Software version: PDF)

- MatchIt Package for R: Most of the features of CEM are also available through the MatchIt Package front end.
- CEM for Stata (version 10 or later):

- To install, type:
  net from http://gking.harvard.edu/cem/
  net install cem
- You can also install from the SSC:
  ssc install cem
- For documentation, type "help cem" or download PDF (or the published version in The Stata Journal: PDF).

- Please send ALL questions, bugs, and requests to our mailing List (you must subscribe to send): [Un]Subscribe, or Browse/Search Archives
- Be notified automatically of cem updates