title: R: Propensity Score Matching using MatchIt. How to find the number of matched observations with replace = TRUE?
body: <p>Please consider the following:</p>
  
  <p>I am matching data with the <code>MatchIt</code> package in R. I have fewer controls than treated and use the option <code>replace = TRUE</code>. According to the <a href="https://imai.fas.harvard.edu/research/files/matchit.pdf" rel="nofollow noreferrer">manual</a>, the weights tell us the frequence of the matched controls.</p>
  
  <p>From the manual:</p>
  
  <blockquote>
    <p>"For matching with replacement, use <code>replace = TRUE</code>. After matching with replacement, the weights can be used to reflect the frequency
    with which each control unit was matched."</p>
  </blockquote>
  
  <p>However, I don't understand why the weights can have decimals and how that would reflect the frequency.</p>
  
  <p>For example, I added <code>replace == TRUE</code> to the example in the manual (see page 18):</p>
  
  
  
  <pre class="lang-r prettyprint-override"><code>library("dplyr")
  library("MatchIt")
  
  m.out1 &lt;- matchit(treat ~ re74 + re75 + age + educ, data = lalonde,
   method = "nearest", distance = "logit", replace = T)
  
  tail(match.data(m.out1), 15)
  #&gt;         treat age educ black hispan married nodegree re74 re75      re78
  #&gt; PSID388     0  19   11     1      0       0        1    0    0 16485.520
  #&gt; PSID390     0  48   13     0      0       1        0    0    0     0.000
  #&gt; PSID392     0  17   10     1      0       0        1    0    0     0.000
  #&gt; PSID393     0  38   12     0      0       1        0    0    0 18756.780
  #&gt; PSID396     0  48   14     0      0       1        0    0    0  7236.427
  #&gt; PSID398     0  17    8     1      0       0        1    0    0  4520.366
  #&gt; PSID400     0  37    8     1      0       0        1    0    0   648.722
  #&gt; PSID401     0  17   10     1      0       0        1    0    0  1053.619
  #&gt; PSID407     0  23   12     0      0       0        0    0    0  3902.676
  #&gt; PSID409     0  17   10     0      0       0        1    0    0 14942.770
  #&gt; PSID411     0  18   10     1      0       0        1    0    0  5306.516
  #&gt; PSID413     0  17   10     0      0       1        1    0    0  3859.822
  #&gt; PSID419     0  51    4     1      0       0        1    0    0     0.000
  #&gt; PSID423     0  27   10     1      0       0        1    0    0  7543.794
  #&gt; PSID425     0  18   11     0      0       0        1    0    0 10150.500
  #&gt;          distance weights
  #&gt; PSID388 0.4067545     0.6
  #&gt; PSID390 0.4042321     1.2
  #&gt; PSID392 0.3974677     0.6
  #&gt; PSID393 0.4016920     4.2
  #&gt; PSID396 0.4152715     0.6
  #&gt; PSID398 0.3758217     1.8
  #&gt; PSID400 0.3595084     0.6
  #&gt; PSID401 0.3974677     1.2
  #&gt; PSID407 0.4144044     1.8
  #&gt; PSID409 0.3974677     0.6
  #&gt; PSID411 0.3966277     1.2
  #&gt; PSID413 0.3974677     1.2
  #&gt; PSID419 0.3080590     0.6
  #&gt; PSID423 0.3890954     1.2
  #&gt; PSID425 0.4076015     1.2
  </code></pre>
  
  <p>For control "PSID393" the weight is 4.276. Hence, I would assume that this control was matched 4 or 5 times (after rounding).</p>
  
  <p>We can however also look at the <code>match.matrix</code> to see the matched treatment and controls one by one. Filtering for "PSID393", we see that the control has actually been matched 7 times:</p>
  
  <pre class="lang-r prettyprint-override"><code>m.out1$match.matrix %&gt;% data.frame() %&gt;% filter(X1 == "PSID393")
  
  
  #&gt;        X1
  #&gt; 1 PSID393
  #&gt; 2 PSID393
  #&gt; 3 PSID393
  #&gt; 4 PSID393
  #&gt; 5 PSID393
  #&gt; 6 PSID393
  #&gt; 7 PSID393
  </code></pre>
  
  <p><sup>Created on 2019-05-06 by the <a href="https://reprex.tidyverse.org" rel="nofollow noreferrer">reprex package</a> (v0.2.1)</sup></p>
  
  <p><strong>How can interpret these two outputs correctly?</strong></p>