McNemar 检验

  • 非独立样本的卡法检验,用McNemar 检验


    McNemar 检验_第1张图片

    McNemar 检验_第2张图片
    image.png

    McNemar 检验_第3张图片
    image.png
  • 使用条件


    McNemar 检验_第4张图片
    image.png

python 实现

from statsmodels.sandbox.stats.runs import mcnemar
f_obs = np.array([[20, 21],[43, 16]])
(statistic, pVal) = mcnemar(f_obs)
print('p = {0:5.3e}'.format(pVal))
if pVal < 0.05:
    print("There was a significant change in the disease by the treatment.")
p = 8.147e-03
There was a significant change in the disease by the treatment.

参考文献

https://www.youtube.com/watch?v=aR7hZOoR7lM

你可能感兴趣的:(McNemar 检验)