Hello I'm using the `MatchIt`

package in R

I have a total of unmatched 116 treated cases and 462 unmatcehd non-treated case

with the command

`mod_match_logit = matchit(f.build("treatement_yes_or_no", covariates), method = "nearest", distance = "logit", data = df, caliper = 0.05, ratio = 3) `

I get then a result of 91 matched treated cases with 248 matched non treated cases. What I don't understand is that, with a 3:1 matching, I should have 91*3 = 273 matched non treated cases (and not 248). Per default is the command `replace`

set to `F`

in `MatchIt`

, so it doesn't explain the difference for me. What am I missing?

**Contents**hide

#### Best Answer

The `ratio`

argument sets the *maximum* number of controls to match to each treated unit. If there aren't enough control units, you won't get 3 control units per treated unit, but `matchit`

will issue a warning. If you use a caliper and there are treated units for which there are fewer than 3 controls in its acceptable region, some treated units will not have 3 controls (but there won't be a warning). You can take a look at which treated units have fewer than 3 matches by looking at `mod_match_logit$match.matrix`

. The ones with `"NA"`

are ones that don't have all the matches.

Also, I noticed you're using my package *cobalt* based on your use of `f.build`

. I hope it's working well for you.

### Similar Posts:

- Solved – Nearest Neighbor Matching in R using matchit
- Solved – 1:1 nearest neighbor propensity score matching in R (MatchIt package)
- Solved – Optimal matching with caliper in MatchIt package in R?
- Solved – the purpose of using MatchIt in R with nearest neighbors for estimation of ATE if it does not report which pairs are matched
- Solved – Categorical variable as control variable in MatchIt