MatchIT中标准化差异的公式?

时间:2015-03-25 02:16:13

标签: r matching

我正在使用MatchIt根据倾向得分进行匹配,然后我正在检查标准化差异。我尝试手动计算一些匹配变量的标准化差异,但我得到的结果与模型输出的结果不同。

#run the model 
ps<-matchit(y ~ ., data=mydata, method = "nearest", distance = "logit")
#store the results as a data frame 
comp <- as.data.frame(summary(ps, standardize = TRUE)["sum.matched"])
#print the results 
comp[, "sum.matched.Std..Mean.Diff." , drop=FALSE]

我的问题是:有没有人知道手动计算matchIt包中使用的标准化差异的公式?我对手段和比例的标准化差异的公式感兴趣(它们是不同的吗?也许这就是原因)

2 个答案:

答案 0 :(得分:0)

我有同样的问题,我认为MatchIt使用的公式与最常用的公式不同。

根据Ho等人的文章(http://imai.princeton.edu/research/files/matchit.pdf) “standardize = TRUE选项将打印出标准化版本 平衡差异的平均差异是由标准化(划分)的 原始治疗组的标准差。“

所以包的公式中的分母应该是s(处理过的),而不是s的平方根(已处理)^ 2 + s(控制)^ 2.

答案 1 :(得分:0)

我根据数据中的变量类型使用以下公式:使用 stddiff 包。

SD1<- stddiff.numeric(data = Edrees, gcol = 1, vcol = ,2:4)
SD2<- stddiff.binary(data= Edrees, gcol = 1 , vcol = 6)
SD3<- stddiff.category(data = Edrees, gcol = 1, vcol = 7)