Skip to main content
edited tags
Link
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663
added 75 characters in body
Source Link
Noah
  • 36.8k
  • 3
  • 53
  • 125

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 aratio= 1:1 match, see photo.

Also, if someone could clarify the difference between Matched (ESS) and Matched (Unweighted) thatreplace would= beFALSE, usefulreuse. I am still unclear from the MatchIt Vignettes on how these are different in the exact matchingmax case= (not1, coarsenedk2k exact= matchingTRUE)

  [1]: https://i.sstatic.net/SSUmy.png

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)

enter image description here

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)

                        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)

  [1]: https://i.sstatic.net/SSUmy.png

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)

enter image description here

Source Link

MatchIt Exact Matching without replacement (1:1)

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)

                        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)

  [1]: https://i.sstatic.net/SSUmy.png