【问题标题】:Formula for standardized differences in MatchIT?MatchIT中标准化差异的公式?
【发布时间】:2015-03-25 02:16:13
【问题描述】:

我使用 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 包中使用的标准化差异的公式吗?我对平均值和比例的标准化差异的公式感兴趣(它们不同吗?也许这就是原因)

【问题讨论】:

  • 要求一个公式真的不是一个特定的编程问题。如果您想了解有关统计模型或方法的更多信息,最好向Cross Validated 提问。如果你想知道这个函数的确切作用,请查看how to find the source code for an R function
  • 我很难阅读该函数的源代码。这就是我需要帮助的地方。将编辑以突出显示。

标签: r matching


【解决方案1】:

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

根据何等人的文章 (http://imai.princeton.edu/research/files/matchit.pdf) “standardize = TRUE 选项将打印出标准化版本 的平衡措施,其中平均差被标准化(除以) 原始治疗组的标准差。”

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

【讨论】:

    【解决方案2】:

    我根据数据中的变量类型使用了以下公式:使用 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)
    

    【讨论】:

      猜你喜欢
      • 2020-05-24
      • 2018-01-16
      • 2020-05-26
      • 1970-01-01
      • 2018-10-27
      • 2022-02-22
      • 1970-01-01
      • 1970-01-01
      • 2014-08-26
      相关资源
      最近更新 更多