【问题标题】:How to do 10-nearest neighbour propensity score matching? I only seem to found 1-1 nearest neighbour matching online如何进行 10-最近邻倾向得分匹配?我似乎只在网上找到了 1-1 个最近邻匹配
【发布时间】:2021-07-01 09:20:31
【问题描述】:

#1:1 最近邻

mod_match_one <- matchit(treatment ~ variable1 + variable2 + variable3, method = "nearest", data = trial_fixed, distance = "glm")

#如果我被告知要找到最近的 10 个邻居,这是否正确?

mod_match_ten <- matchit(treatment ~ variable1 + variable2 + variable3, method = "nearest", data = trial_fixed, distance = "glm", ratio = 4)

#或者这是正确的吗?我很困惑……

mod_match_ten <- matchit(treatment ~ variable1 + variable2 + variable3, method = "full", data = trial_fixed, distance = "glm", min.controls = 1, max.controls = 10)

【问题讨论】:

  • 欢迎堆栈溢出。如果您使您的问题可重现,则更容易提供帮助:以对象的形式包含一个最小数据集,例如,如果数据框为 df minimal reproducible example 和 How to Ask

标签: r glm nearest-neighbor propensity-score-matching


【解决方案1】:

如果您设置ratio = 10,您的第二个代码块是正确的。我不确定 4 来自哪里。请注意,这将执行最近邻匹配而不进行替换,这意味着如果每个处理单元没有 10 个控制单元,您将无法找到所有处理单元的匹配项。要使用替换进行最近邻匹配,请设置replace = TRUE

【讨论】:

    猜你喜欢
    • 2017-07-11
    • 1970-01-01
    • 1970-01-01
    • 2018-08-11
    • 2022-01-07
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 1970-01-01
    相关资源
    最近更新 更多