I am trying to use the MatchIt package to conduct exact matching on several categorical variables (sex, zipcode and an eligibility group code). After matching I want to have the same number of treated units as control units, and I want it to randomly pick the control unit for each treated unit if there are several potential ones. For some reason that doesn’t seem to be possible in the MatchIt package as far as I can tell.
I have tried many arguments with the method = "exact" but none seem to work. When I use ratio = 1:1 argument but get the error: 'ratio' is not used with method = "exact" and will be ignored. I've tried replace = FALSE, and/or reuse.max = 1 and/or k2k = TRUE but still get more matched treated than controls. Listing my code below with all arguments used (though I've used them all individually with no luck either)
m.out1_exact <- matchit(treat ~ sex_cd + cvrg_grp_cd + zipcode,
data = df_match_zip,
method = "exact", replace = FALSE,
ratio= 1:1, replace = FALSE, reuse.max = 1, k2k = TRUE)
I end up matching 1 treated unit to many controls, when I want a 1:1 match, see photo.
Also, if someone could clarify the difference between Matched (ESS) and Matched (Unweighted) that would be useful. I am still unclear from the MatchIt Vignettes on how these are different in the exact matching case (not coarsened exact matching)