我一直在使用R中的MatchIt包进行治疗与控制匹配,而我无法获得最佳匹配以使用我自己的数据集。MatchIt:最佳匹配失败
如果我运行下面的代码:
m.out <- matchit(match_formula, data=stats, method='optimal', distance='logit', ratio=2)
其中公式是
treatment ~ t_1 + t_2 + t_3 + t_4 + t_5 + t_6 + t_7 + t_8 + t_9 +
t_10 + t_11
然后我结束了错误
Error in fullmatch.matrix(d, min.controls = ratio, max.controls = ratio, : omit.fraction must be NULL or numeric between -1 and 1
我不能在任何地方找到matchit
方法来指定一个omit.fraction变量或甚至做什么。有没有办法绕过这个bug并执行最佳匹配?
请做一个可重现的例子:http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – emilliman5
'matchit'使用'fullmatch'函数从'optmatch'包。从那里查看帮助文件。 – lmo