I'm running Gary King's %CEM SAS macro (available here) for coarsened exact matching (CEM) for a project at work.

The macro works fine for estimating the Average Treatment Effect on the Treated (ATT) and returns sample weights (labelled Wsc1_stur) for that purpose.

We're also interested in estimating the overall Average Treatment Effect (ATE) using CEM.

Is there an option in the %CEM macro for calculating the ATE?


1 Answer 1


First, be aware that if any units are discarded (i.e., not matched), you will not be estimating the ATE but rather the ATE in the matched sample.

This option is not available in the %CEM macro. If you have access to stratum membership, you can produce stratum weights manually. For each stratum $S$, the treated units get a weight of $\frac{N_S}{N_{S,1}}$ and the control units get a weight of $\frac{N_S}{N_{S,0}}$, where $N_S$ is the number of units in stratum $S$, $N_{S,1}$ is the number of treated units in stratum $S$, and $N_{S,0}$ is the number of control units in stratum $S$.

It may also be possible to call the R package MatchIt from within SAS (e.g., using the %PROC R macro), which has support for ATE weights form coarsened exact matching.

  • $\begingroup$ Thanks Noah! Yes, looking in the %CEM macro code I bet I can manually code the ATE weights using your formula. BTW the following blog post on CEM uses different formulas for the ATE weights: towardsdatascience.com/… . Are they equivalent to the weight formula you provided? $\endgroup$
    – RobertF
    Jan 27, 2022 at 20:58
  • 1
    $\begingroup$ The formula they provide is the same except for a scaling factor applied to the weights of $1/\left(1+\frac{N_0}{N_1}\right)$ for treated and $1/\left(1+\frac{N_1}{N_0}\right)$ for control. Including a constant scaling factor doesn't affect balance, the difference in outcome means, or the results of a fully interacted outcome model. In MatchIt, I use a scaling factor (not sure if it's actually this one) to ensure the average of the nonzero is equal to 1 in each group. $\endgroup$
    – Noah
    Jan 27, 2022 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.