CEM 1-to-1 Example

Introduction

In CEM Example, we explore an Coarsened Exact Matching example using the data from the Lalonde study. The approach described uses weights. There is an alternative approach that avoids the use of weights, but at the cost of additional loss of information.

We repeat Example 1 from CEM Example, but this time we choose the 1 to 1 pairing of treatment and control elements option from the dialog box for the Coarsened Exact Matching data analysis tool (see Figure 3 in CEM Example).

Coarsening

The data analysis uses the same approach for coarsening the data using the array formula =CEM_Coding(A1:F723,I1:K4), as shown in Figure 1 (only the first 11 and last 7 of 722 rows of coarsened data are displayed).

Coarsening

Figure 1 – CEM coarsening

Bin Signatures

Bin signatures are defined as in CEM Example). Once again there are 86 bin signatures, the first 10 of which are shown in Figure 2. Again the output in range Z4:AD89 is created via the array formula =SortsRowsUnique(Q429:U725).

Bin signatures

Figure 2 – Bin signatures

The bin signature indices shown in column V of Figure 1 are filled in using the RowMatch worksheet function as in CEM Example. Similarly, the counts in columns AE and AF of Figure 2 are filled in as in CEM Example.

Pairing

For example, we see from row 5 of Figure 2 that there are 6 treatment subjects with bin signature index 2 and 12 control subjects with this bin signature index. Since we need a balance between treatment and control subjects, we need to prune 12 – 6 = 6 control subjects. This is done at randomly. 

For row 6 (bin signature index 3), we see that there are 4 treatment and 3 control matches, and so we need to prune 1 treatment subject at random. For row 7 (bin signature index 4), there are two matching treatment subjects and no control subjects. Thus, we need to prune both treatment subjects.

The data analysis tool does this by inserting the array formula

=CEM_Pairing(V4:V725, AE4:AF89)

in range W4:W725 of Figure 1. The result is a 1 for each coarsened row that is retained and a 0 for each row that is to be pruned. 

Pruning

Next the data analysis tool, prunes any entry from the original data which has a corresponding zero in column W. This is done using the array formula =Pruning(A1:G723,W3:W725,FALSE). Here A1:G723 contains the original data (that corresponds to the coarsened data in Figure 1). The result is shown in Figure 3 (only the first 10 of 490 data rows are displayed).

Retained rows

Figure 3 – Pruned Data

Match Quality

As in CEM Example, the quality of the matching is investigated using the array formula =MatchQuality(AI3:AO493) with output as shown in Figure 4.

CEM Match Quality

Figure 4 – Match Quality

Since this version of CEM doesn’t use weights, the output contains two more rows compared to that shown in Figure 7 of CEM Example.

We see from cell AY20 that there isn’t a significant difference in re78 between the treatment and control groups with p-value = .146984 for the Mann-Whitney test. We can get further information by using the Mann-Whitney test on the data in Figure 3.

Observation

If some bin signature has no matching subject from the control group, then any matching treatment subjects are pruned. Any other bin signature imbalance between treatment and control subjects results in one or more subjects pruned at random. Since this is done randomly, the actual resulting sample can vary from one run to another, and so the test results can change.

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

References

King, G. (2015) Why propensity scores should not be used for matching
https://www.youtube.com/watch?v=rBv39pK1iEs

Huntington-Klein, N. (2012) Coarsened exact matching and entropy balancing
https://www.youtube.com/watch?v=M6AsS4zaWQk

Blackwell, M., Iacus, S., King, G., Porro, G. (2011) CEM for SPSS
https://projects.iq.harvard.edu/cem-spss/pages/how-use-cem-spss

Huffman, A. (2017) CEM; Coarsened exact matching explained
https://medium.com/@devmotivation/cem-coarsened-exact-matching-explained-7f4d64acc5ef

Wu, W. (2023) Coarsened exact matching
https://cem-linearinf.readthedocs.io/en/latest/tuto_cem.html

Leave a Comment