【问题标题】:Understanding "ratio" parameter in matchit()了解 matchit() 中的“比率”参数
【发布时间】: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。 为了完整起见:在公式调用中切换 blackage 不会改变输出。

我从对Exact age matched match with Matchit doesn't work. 的回复中确实意识到控制:治疗比率倾斜是问题的一部分,但是我不明白为什么ratio 参数不能解决这个问题。

并且,为了完整起见:为什么 matchit() 函数 matchit(treat ~ re74 + re75 + educ + black + hispan + age,data = lalonde, method = "nearest") 的文档中的示例调用中没有出现此问题?

感谢您的帮助。

【问题讨论】:

    标签: r match matching


    【解决方案1】:

    method = "exact"ratio 参数被忽略。如果您想要 1:1 匹配(我不知道您为什么会这样做,因为更精确的匹配总是更好,其他条件相同),只需丢弃一些匹配的控制单元。此外,您误读了输出:匹配对照与处理的比率为 262 到 161,这与原始样本中对照与处理的比率不同。

    使用method = "nearest" 时不会出现问题,因为该方法不会忽略ratio 参数,如文档中所述。

    【讨论】:

      猜你喜欢
      • 2021-12-14
      • 1970-01-01
      • 2020-05-28
      • 2012-11-05
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 2014-07-19
      • 2020-06-23
      相关资源
      最近更新 更多