The matching order is controlled by the m.order
argument, as explained in the documentation for matchit()
. There are four options currently available:
"largest"
- matches treated units with the highest propensity score first (in theory, these will be the hardest to match); this is the default for propensity score matching
"smallest"
- matches the treated units with the lowest propensity score first (in theory, these will be the easiest to match)
"data"
- matches treated units in the order they appear in the dataset; this is the default for Mahalanobis distance matching or when matching on a distance matrix
"random"
- matches treated units in a random order
All of these are deterministic except "random"
, meaning you will get the same results each time you run them. With m.order = "random"
, changing the seed should yield different results each time and you must set a seed to be able to replicate the match. Only "data"
is affected by the order of the data, so reordering your data will not change matches using the other options.
Another option is to use method = "optimal"
, which performs optimal matching. Optimal matching is also a deterministic algorithm that minimizes the overall within-pair distances in the full sample, not just in one pair at a time. In this way, it avoids the arbitrariness of greedy matching.
The literature has also described another method that can work well but isn't implemented in MatchIt
, which is to match treated units with the closest control unit first. This algorithm is slower and often performs similarly to "smallest"
anyway.