医药项目统计联系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代码测试一致

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

例题2

python结果无显著差异

例题3

练习

 https://study.163.com/provider/400000000398149/index.htm?share=2&shareId=400000000398149(欢迎关注博主主页,学习python视频资源)

McNemar test麦克尼马尔检验的更多相关文章

  1. 班尼特·A·麦克道尔 - 一个交易者的资金管理系统(2013年5月26日)

    <一个交易者的资金管理系统:如何确保利润并避免破产风险> 作 者:班尼特·A·麦克道尔 系 列:“引领时代”金融投资系列-世界交易经典译丛 出 版:万卷出版公司 字 数:155千字 阅读完 ...

  2. NLP —— 图模型(一)隐马尔可夫模型(Hidden Markov model,HMM)

    本文简单整理了以下内容: (一)贝叶斯网(Bayesian networks,有向图模型)简单回顾 (二)隐马尔可夫模型(Hidden Markov model,HMM) 写着写着还是写成了很规整的样 ...

  3. 基于GPS数据建立隐式马尔可夫模型预测目的地

    <Trip destination prediction based on multi-day GPS data>是一篇在2019年,由吉林交通大学团队发表在elsevier期刊上的一篇论 ...

  4. 隐马尔可夫模型(HMM)及Viterbi算法

    HMM简介   对于算法爱好者来说,隐马尔可夫模型的大名那是如雷贯耳.那么,这个模型到底长什么样?具体的原理又是什么呢?有什么具体的应用场景呢?本文将会解答这些疑惑.   本文将通过具体形象的例子来引 ...

  5. 13张动图助你彻底看懂马尔科夫链、PCA和条件概率!

    13张动图助你彻底看懂马尔科夫链.PCA和条件概率! https://mp.weixin.qq.com/s/ll2EX_Vyl6HA4qX07NyJbA [ 导读 ] 马尔科夫链.主成分分析以及条件概 ...

  6. Viterbi算法和隐马尔可夫模型(HMM)算法

    隐马尔可夫模型(HMM)及Viterbi算法 https://www.cnblogs.com/jclian91/p/9954878.html HMM简介   对于算法爱好者来说,隐马尔可夫模型的大名那 ...

  7. 隐马尔可夫模型(HMM)及Viterbi算法

    HMM简介 对于算法爱好者来说,隐马尔可夫模型的大名那是如雷贯耳.那么,这个模型到底长什么样?具体的原理又是什么呢?有什么具体的应用场景呢?本文将会解答这些疑惑. 本文将通过具体形象的例子来引入该模型 ...

  8. 【强化学习】MOVE37-Introduction(导论)/马尔科夫链/马尔科夫决策过程

    写在前面的话:从今日起,我会边跟着硅谷大牛Siraj的MOVE 37系列课程学习Reinforcement Learning(强化学习算法),边更新这个系列.课程包含视频和文字,课堂笔记会按视频为单位 ...

  9. 隐马尔可夫模型及Viterbi算法

    隐马尔可夫模型(HMM,hidden Markov model)是可用于标注问题的统计学模型,描述由隐藏的马尔可夫链随机生成观测序列的过程,属于生成模型.HMM模型主要用于语音识别,自然语言处理,生物 ...

随机推荐

  1. java不用任何已有方法完全自写的去重法

    package aa; class InsertSort{ private long[] a; private int nElems; //构造方法 public InsertSort(int max ...

  2. World Cup(思维+模拟)

    Description Allen wants to enter a fan zone(球迷区) that occupies a round square and has nn entrances. ...

  3. C#从一个窗体传递参数到另一个窗体的链接

    http://blog.sina.com.cn/s/blog_60d69ce00100eldt.html

  4. Traffic Steering for Service Function Chaining

    Introduction 目前通过vlan标签来把流量引向对应的sfc 以前的sfc静态(SFs相邻组成SFC),有了sdn之后具有动态性.(SFs不需要彼此相邻.将流量动态地导向所需的SFs.) 流 ...

  5. 事后诸葛亮--Alpha版本总结

    目录 设想和目标 计划 资源 变更管理 设计/实现 测试/发布 团队的角色,管理,合作 总结: 本小组和其他组的评分 分工和贡献分 全组讨论的照片 问题 第一组提问回答:爸爸饿了队 第二组提问回答:拖 ...

  6. springboot+vue+element:echarts开发遇见问题---后端sql(三)

    <select id="getSumRequestRankingCount" parameterType="java.lang.String" resul ...

  7. APUE(unix环境高级编程)第三版---first day---部署书中实例的运行环境(apue.h)

    操作环境:RHEL7.0 部署apue.h实例运行环境 1.下载头文件src.3e.tar.gz 2.解压 tar zxvf src.3e.tar.gz 3.创建普通用户(我仿照书上创建的sar用户) ...

  8. Lucene 常用名词解析

    索引的创建:IndexWriter: 用于创建索引Directory: 这个可以用来定义我们的索引是存放在内存中还是在硬盘上Analyzer: 分词器 有几种()这个地方需要好好解释下Document ...

  9. phpdisk 盲注 &前台任意用户登录

    代码审核 文件 plugins\phpdisk_client\passport.php 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 $str ...

  10. MQTT协议-----订阅

    MQTT协议笔记之订阅      http://www.blogjava.net/yongboy/archive/2014/04/12/412351.html MQTT - chszs的专栏    h ...