# 1:1 nearest neighbor propensity score matching in R (MatchIt package)

I used 1:1 nearest neighbor propensity score matching in R (MatchIt package) to match samples from an experimental group with a control sample. I used the procedure described here: https://pareonline.net/pdf/v19n18.pdf

Now I wonder if I can identify which 2 people in my dataset are a matched pair. Is it possible to identify the exact "matching partner" in experimental and control group?

You need to use the call to $match.matrix after the variable containing your matching results. For example, using the first example in your linked paper, you would issue the following commands: m.out = matchit(stw ~ tot + min + dis, data = mydata, method = "nearest", ratio = 1) m.out$match.matrix

> m.out<-matchit(treat~age+educ+black, method="nearest", ratio=1, data=lalonde)
> my.matches<-m.out$match.matrix > head(my.matches) 1 NSW1 "PSID357" NSW2 "PSID62" NSW3 "PSID113" NSW4 "PSID170" NSW5 "PSID280" NSW6 "PSID3"  Note that no other options are needed in this example since the IDs are first in the rownames in the lalonde dataset. You may need to assign IDs to your rownames first by: row.names(lalonde)<-lalonde$my.subject.id