I used thematchit()
and Method="nearest"
. But when I try to save the output into a data.frame
by match.data()
, the error shows up:
Error in cbind_all(x) : Argument 2 must have names.
My Code:
a = matchit(Y ~ Year + IndustryCode + ROA + Debt,
data=data, method="nearest", ratio=1)
b = match.data(a)
- Year variable = 2003, 2004 etc.
- IndustryCode = A02, A21 etc.
- other variables are numeric.
Those are the warnings after matchit()
:
Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred
2: In matchit2nearest(c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, :
Fewer control than treated units and matching without replacement. Not all treated units will receive a match. Treated units will be matched in the order specified by m.order: largest.
What do you think is the reason?