title: Exact matching and GenMatch in R
body: <p>So following the example from the Matching package and in particular the GenMatch example
  <a href="http://cran.r-project.org/web/packages/Matching/Matching.pdf" rel="noreferrer">Link to pdf here</a></p>
  
  <p>Following the example here</p>
  
  <pre><code>library(Matching)
  data(lalonde)
  attach(lalonde)
  
  X = cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74)
  
  BalanceMat &lt;- cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74,
                      I(re74*re75))
  
  genout &lt;- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE", M=1,
                     pop.size=16, max.generations=10, wait.generations=1)
  
  Y=re78/1000
  
  mout &lt;- Match(Y=Y, Tr=treat, X=X, Weight.matrix=genout)
  summary(mout)
  </code></pre>
  
  <p>We see that all the treatment cases are matched with control cases. Now lets say we want exact matching on married status, (or any other variable). But we want to still use the GenMatch matrix created before.</p>
  
  <p>Referring to the link</p>
  
  <p>Exact = .....If a logical vector is provided, a logical value should be provided for each covariate in X. Using a logical vector allows the user to specify exact matching for some but not other variables. When exact matches are not found, observations are dropped.</p>
  
  <p>Therefore is the following correct??</p>
  
  <pre><code>mout2 &lt;- Match(Y=Y, Tr=treat, X=X, exact=c(0,0,0,0,1,0,0,0,0,0), Weight.matrix=genout)
  summary(mout2)
  </code></pre>
  
  <p>I would say that has not been correct, as if you compare</p>
  
  <pre><code>summary(mout$weights)
  summary(mout2$weights)
  </code></pre>
  
  <p>You get the same values</p>