【发布时间】:2019-07-16 11:58:35
【问题描述】:
我无法理解 matchit() 函数中的“比率”参数。
根据文档,ratio = 1 参数与 method = "nearest" 应匹配 1:1 比率案例和控件。
然而,在这种情况下,它似乎只是反映了原始变量的分布:
library(MatchIt)
data("lalonde")
attach(lalonde)
table(treat) # 429 non treated, 185 treated
prop.table(table(treat)) # 0.699 non treated, 0.301 treated
table(age, treat); t.test(age ~ treat) # different
table(black, treat); chisq.test(black, treat) # different
detach(lalonde)
m_exact_test <- matchit(treat~age + black, data = lalonde, method = "exact", ratio = 1)
调用m_exact_test 返回:
Call:
matchit(formula = treat ~ age + black, data = lalonde, method = "exact",
ratio = 1)
Exact Subclasses: 34
Sample sizes:
Control Treated
All 429 185
Matched 262 161
Unmatched 167 24
363:161 的比率再次为 0.619 比 0.381。
为了完整起见:在公式调用中切换 black 和 age 不会改变输出。
我从对Exact age matched match with Matchit doesn't work. 的回复中确实意识到控制:治疗比率倾斜是问题的一部分,但是我不明白为什么ratio 参数不能解决这个问题。
并且,为了完整起见:为什么 matchit() 函数 matchit(treat ~ re74 + re75 + educ + black + hispan + age,data = lalonde, method = "nearest") 的文档中的示例调用中没有出现此问题?
感谢您的帮助。
【问题讨论】: