微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在wilcoxon秩和检验中找到95%的置信区间用于加法治疗效果

如何解决如何在wilcoxon秩和检验中找到95%的置信区间用于加法治疗效果

下面是我的数据集:

    stereograms <- structure(list(Time = c(47.2,22,20.4,19.7,17.4,14.7,13.4,13,12.3,12.2,10.3,9.7,9.5,9.1,8.9,8.4,8.1,7.9,7.8,6.9,6.3,6.1,5.6,4.7,4.3,4.2,3.9,3.4,3.1,2.7,2.4,2.3,2.1,2,1.9,1.7,16.2,15.9,15.4,8.6,7.4,6,5.9,4.9,4.6,3.8,3.6,3.5,3.3,2.9,2.8,1.8,1.6,1.4,1.2,1.1,1),condition = c(1L,1L,2L,2L)),class = "data.frame",row.names = c(NA,-78L))

我已通过以下代码完成了wilcoxon秩和检验:

rawdatatest  <- wilcox.test(Time ~ condition,conf.int = TRUE,exact = TRUE,data = stereograms)

# Warning messages:
# 1: In wilcox.test.default(x = c(47.2,:
#   cannot compute exact p-value with ties
# 2: In wilcox.test.default(x = c(47.2,:
#   cannot compute exact confidence intervals with ties

rawdatatest

#   Wilcoxon rank sum test with continuity correction
#
# data:  Time by condition
# W = 973,p-value = 0.02706
# alternative hypothesis: true location shift is not equal to 0
# 95 percent confidence interval:
#  0.1999475 4.2999223
# sample estimates:
# difference in location 
#               1.800068 

现在如何计算上述数据集的加成治疗效果的95%置信区间?

解决方法

如果您认为Wilcoxon测试结果是平均治疗效果(ATE),那么

其中N是观察到的单位数,为了获得累加处理效果,您要做的就是将ATE乘以N。

在您的示例中,condition是不平衡的,但我们假设已处理condition = 2。因此,95%c.i.

N = length(stereograms$Time[stereograms$condition==2])
additive_treatment = rawdatatest$conf.int*N

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。