我正在使用 matchit 包对数据集进行倾向得分匹配。但是,在进行最近邻匹配时,如果我使用 caliper 选项,我每次都会得到一组不同的匹配对 - 即第一次处理 #18 匹配到控制 #2276,但如果我重新运行代码,处理 #18 匹配控制#2079(等等)。如果我移除卡尺选项,我每次都会得到相同的匹配结果,但是移除卡尺后产生的额外匹配会根据我的喜好产生距离有点远的匹配。
例如,如果我运行以下代码,请注意控制方式的差异:
match.out <- matchit(Category ~ FactorA + FactorB, Data,
method = 'nearest', distance = 'logit', caliper = .10)
round(summary(match.out)$sum.matched, digits = 3)
Means Treated Means Control SD Control Mean Diff
distance 0.506 0.496 0.151 0.010
FactorA 24.243 24.450 3.344 -0.207
FactorB 3.542 3.551 0.392 -0.008
match.out <- matchit(Category ~ FactorA + FactorB, Data,
method = 'nearest', distance = 'logit', caliper = .10)
round(summary(match.out)$sum.matched, digits = 3)
Means Treated Means Control SD Control Mean Diff
distance 0.506 0.496 0.151 0.010
FactorA 24.243 24.427 3.351 -0.184
FactorB 3.542 3.541 0.392 -0.002
这对我来说是个问题,因为如果需要,我更希望能够准确地重现我的结果。但是我可以在没有 caliper 参数的情况下运行 matchit:
match.out <- matchit(Category ~ FactorA + FactorB, Data,
method = 'nearest', distance = 'logit')
并全天获得完全相同的治疗控制匹配。(我实际上检查了匹配矩阵来验证这一点 - 这不仅仅是偶然的相同控制平均值)。
有没有办法仍然使用卡尺进行我在第一个代码块中所做的最近邻匹配,以稍微缩小我的匹配范围,但如果我重新运行代码仍然得到相同的结果?
感谢您提供任何帮助(不仅是在这个问题上,而是所有 - 虽然这是我觉得有必要在这里发布的第一个问题,但我在这里找到了很多答案)