Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get Coarsened Exact Matching (CEM) do an exact match on some variables - possible solution

    Dear all,


    while using Coarsened Exact Matching (CEM), one of the striking things I noticed was that the algorithm does not offer an option which allows the user to ask for an exact match on some variables (unlike other matching algorithms such as matching estimators). Suppose we are talking about companies and one variable tells the nationality of firms - with nationality being not the treatment variable - and assume one wants matched pools made of only firms coming from the same country as the treated observation, the algorithm seems to offer no options to do that.

    For this reason, I devised a solution using a loop. I am showing that on the forum because I am not completely sure this is the cleverest way to do that and, secondly, because I'd like to hear whether someone thinks there are good reasons not to implement that.

    Code:
    tempfile `"`results'"'
    save `"`results'"', emptyok
    local nation italy spain france us colombia
    
    foreach country of local nation{
    use file.dta if nation==`country'
    capture noisily cem var1 var2 var3, treatment(treat) /// I am doing this because sometimes the subset of file.dta is too small for cem to work
      if _rc==0{
      append using `"`results'"'
      save `"`results'"', replace
      }
    clear
    }

    Many thanks!
    Riccardo
    Last edited by Riccardo Valboni; 03 Jul 2014, 09:17.

  • #2
    Riccardo,

    Buried in the cem documentation are these gems (which for some reason are not more prominent):

    To create a certain number of equally spaced cutpoints, say 10, place "#10" in the parentheses...Using #0 will force cem into not coarsening the variable at all.
    This if you want to match exactly on country:

    Code:
     
     cem nation(#0) var1 var2 var3, treatment(treat)
    Regards, Joe

    Comment


    • #3
      Genius! I had read that passage but for some reason I had not linked that to the possibility of doing an exact match. Many thank for your always great answers. Riccardo

      Comment


      • #4
        Hi Riccardo & Joe,

        I've been looking for the same thing; why CEM algorithm does not provide an exact matching function.
        I'm glad that I found this post thread.
        I read the cem documentation but it would be greatly appreciated if someone could clarify one question.
        Using #0 will force cem into not coarsening the variable at all.
        Does 'not coarsening at all' mean it's going to do an exact match?

        Comment


        • #5
          Yes, thank you Joe and Riccardo! Was looking for this, too. Very subtle...

          Comment

          Working...
          X