博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
McNemar test麦克尼马尔检验
阅读量:5111 次
发布时间:2019-06-13

本文共 1855 字,大约阅读时间需要 6 分钟。

(博主亲自录视频)

医药项目统计联系QQ:231469242

 

McNemar’s Test用于配对的2*2表格,例如如果你要比较两个医生对同一个病人治疗效果。一个病人自控,药物治疗前和治疗后结果比较。

McNemar’s Test用于检验(a+b)/N 和(a+c/N)是否显著?

McNemar’s Test的两个分类变量不是独立的,而是相关的,因为(a+b)/N 和(a+c/N)都包含a

McNemar’s Test This is a matched pair test for 2  *   2 tables. For example,

if you want to see if two doctors obtain comparable results
when checking (the same) patients, you would use this test.

 

 

 

 

 

http://www.doc88.com/p-7337013497692.html

 

 

 

 

 

 

 

 

 python代码测试一致

 

# -*- coding: utf-8 -*-''' QQ:231469242,by Toby '''# Import standard packagesimport numpy as npimport scipy.stats as statsimport pandas as pd# additional packagesfrom statsmodels.sandbox.stats.runs import cochrans_q, mcnemar#药物测试,对疾病是否治愈,要求相同对象群体#obs = np.array([[101, 121],[59, 33]])obs = np.array([[2, 4],[0, 4]])def Mcnemar(obs):    '''McNemars Test should be run in the "exact" version, even though approximate formulas are    typically given in the lecture scripts. Just ignore the statistic that is returned, because    it is different for the two options.        In the following example, a researcher attempts to determine if a drug has an effect on a    particular disease. Counts of individuals are given in the table, with the diagnosis    (disease: present or absent) before treatment given in the rows, and the diagnosis    after treatment in the columns. The test requires the same subjects to be included in    the before-and-after measurements (matched pairs).    '''    (statistic, pVal) = mcnemar(obs)    print('\nMCNEMAR\'S TEST -----------------------------------------------------')    print('p = {0:5.3f}'.format(pVal))    if pVal < 0.05:        print("There was a significant change")      else:       print("There was no significant change")Mcnemar(obs)         '''p = 0.125There was no significant change'''

 

 

 

 

例题2

 

python结果无显著差异

 

 

例题3

 

 

 

 

 

练习

 

 

转载于:https://www.cnblogs.com/webRobot/p/6956342.html

你可能感兴趣的文章
免费的论文查重网站
查看>>
C语言程序第一次作业
查看>>
leetcode-Sort List
查看>>
phpcms
查看>>
中文词频统计
查看>>
[.net 面向对象编程基础] (19) LINQ基础
查看>>
Win10 虚拟桌面
查看>>
了解node.js
查看>>
想做移动开发,先看看别人怎么做
查看>>
Dynamics CRM 2013 初体验(1):系统的安装
查看>>
Ping其他电脑ping不通的解决方法
查看>>
Eclipse相关集锦
查看>>
虚拟化架构中小型机构通用虚拟化架构
查看>>
继承条款effecitve c++ 条款41-45
查看>>
[置顶] OGG-01091 Unable to open file (error 89, Invalid file system control data detected)
查看>>
linux 内核参数VM调优 之 参数调节和场景分析
查看>>
HTML+CSS学习笔记(九)
查看>>
笑谈人生的哲理和智慧
查看>>
【BZOJ2286】【SDOI2011】消耗战 [虚树][树形DP]
查看>>
【Foreign】Game [博弈论][DP]
查看>>