I conducted prospensity score matching in R using the R-package "Matching" and "Matchit" respectively, but the number of matches were completely different.
The dataset is here http://web.hku.hk/~bcowling/data/propensity.csv or http://web.hku.hk/~bcowling/examples/propensity.htm.
example <- propensity
The code using "Matching" was:
m.ps <- glm(trt ~ age + risk + severity, family="binomial", data=example)
example$ps <- predict(m.ps, type="response")
PS.m <- Match(Y=example$death, Tr=example$trt, X=example$ps, M=1, caliper=0.2, replace=FALSE)
summary(PS.m )
SE......... 0.041299
T-stat..... -2.1126
p.val...... 0.034634
Original number of observations.............. 400
Original number of treated obs............... 192
Matched number of observations............... 149
Matched number of observations (unweighted). 149
Caliper (SDs)........................................ 0.2
Number of obs dropped by 'exact' or 'caliper' 43
The number of matches was 149.
The code using "MatchIt" was:
psm<-matchit(trt ~ age+risk+severity, data=example, method="nearest",caliper=0.2)
summary(psm)
Sample Sizes:
Control Treated
All 208 192
Matched 161 161
Unmatched 47 31
Discarded 0 0
The number of matches was 161, and it was different from 149 when using Matching. Why were they different?