麦克尼马尔精确检验

McNemar exact test

我正在 R 中对以下数据执行 McNemar 检验:

得到如下结果:

我理解结果,但是,有人可以向我解释置信区间是如何计算的吗?

您可以在此 vignette and also check out the code 中阅读更多内容。使用此 wiki 图片进行说明:

优势比为 b / c,在您的情况下为 150/86 = 1.744186。您可以围绕成功的比例构造一个二项式置信区间,将 b 视为成功,将试验次数视为 b + c。

在代码中,他们用这段代码来计算:

library(exactci)
CI = binom.exact(150,86+150,tsmethod = "central")
CI

data:  150 and 86 + 150
number of successes = 150, number of trials = 236, p-value = 3.716e-05
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.5706732 0.6970596
sample estimates:
probability of success 
             0.6355932 

你有b的上下界,那么比值比为p / 1- p :

CI$conf.int/(1-CI$conf.int)
[1] 1.329228 2.300979

binom.exact 的小插图指出:

The 'central' method gives the Clopper-Pearson intervals, and the 'minlike' method gives confidence intervals proposed by Stern (1954) (see Blaker, 2000).

所以这是估计二项式置信区间的 many methods 之一。