如何进行10-最近邻倾向得分匹配?网上好像只找到1-1最近邻匹配
How to do 10-nearest neighbour propensity score matching? I only seem to found 1-1 nearest neighbour matching online
#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)
如果您设置 ratio = 10
,则您的第二个代码块是正确的。我不确定 4 来自哪里。请注意,这将执行不带替换的最近邻匹配,这意味着如果每个处理单元没有 10 个控制单元,您将无法找到所有处理单元的匹配项。要使用替换进行最近邻匹配,请设置 replace = TRUE
.
#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)
如果您设置 ratio = 10
,则您的第二个代码块是正确的。我不确定 4 来自哪里。请注意,这将执行不带替换的最近邻匹配,这意味着如果每个处理单元没有 10 个控制单元,您将无法找到所有处理单元的匹配项。要使用替换进行最近邻匹配,请设置 replace = TRUE
.