在 GedMatch 中使用卡尺来鼓励更多配对

Using calipers in GenMatch to enourage more pairs

所以按照 Matching 包中的示例,特别是 GenMatch 示例

Link to package here

按照GenMatch

中的例子

图书馆(匹配)

data(lalonde)
attach(lalonde)

X = cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74)

BalanceMat <- cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74,
                    I(re74*re75))

genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE", M=1,
                   pop.size=16, max.generations=10, wait.generations=1)

genout$matches
genout$ecaliper

Y=re78/1000

mout <- Match(Y=Y, Tr=treat, X=X, Weight.matrix=genout)
summary(mout)

我们看到 185 个治疗观察与 270 个非治疗观察配对。 现在我们想放宽这一点,以便在年龄标准上进行更灵活的配对。

我们可以生成一个 table,左边是治疗案例和他们的年龄,右边是控制案例和年龄:

pairs <- data.frame(mout$index.treated, lalonde$age[mout$index.treated], mout$index.control, lalonde$age[mout$index.control])

现在使用 Match()caliper 函数,我们应该能够生成更轻松的匹配。

我们看到 sd(lalonde$age) 为我们的 table 提供了 7 年的 SD,所以让我们尝试匹配这个限制。一个简单的

mout2 <- Match(Y=Y, Tr=treat, X=X, Weight.matrix=genout, caliper=c(1,0,0,0,0,0,0,0,0,0))
summary(mout2)

这似乎不是因为在 mout2 中发生的 Matched number of observations 少于 mout1

那我哪里错了? 零值必须包含在 caliper 中,否则如果它们为空则返回错误

您对 GenMatch 的第一次调用没有强加任何 卡尺。你的第二个电话强加了一个卡尺,所以匹配的数量会减少。如果您想增加第一次调用的匹配数,请参阅 "M" 选项。您可能想要 1 对 2 匹配等