全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
7751 3
2013-10-28
配对的四格表,在人卫版卫生统计学书写着其统计量为配对的卡方值,计算公式如下图:
配对卡方.jpg


并称该方法为McNemar法,但是从SPSS以及SAS中似乎得不到相关的统计量,SPSS中McNemar法只能得到一个P值,而SAS中McNemar法(也即proc freq,table选项后添加agree)得到的统计量为S,与书上说明的卡方统计量也不一致,同时SPSS与SAS采用McNemar法计算得到的P值也不一致。不知道各位是否知道配对的四格表能否在统计软件中出来书中所说的卡方统计量,同时SPSS和SAS中针对McNemar法的计算方法是否一致,欢迎大家指点。谢谢啦


简答数据如下:
data s;
input r c f@@;
cards;
1 1 25 1 0 6
0 1 9 0 0 40
;
proc freq;
weight f;
tables r*c/norow nocol agree;
run;


SAS结果截图如下:
SAS配对卡方.jpg

SPSS结果截图如下:
SPSS配对卡方.jpg

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-10-28 10:04:27
基本上找到答案了,SPSS与SAS中关于McNemar检验的说明如下:
(1)Spss
McNemar's Test (nonparametric tests algorithms)
For two related samples from a categorical field with 2 values (or a recoded categorical field with more than 2 values), this tests:
H0: The two samples have the same marginal distribution.
Let n1,f be the number of records in which xi is a success and yi is a failure, and n2,f be the number of records in which xi is a failure and yi is a success, incorporating the frequency weights.
SPSS配对卡方公式.jpg
The one sided p-value is
p=Pr(χ21≥χ2)=1−Pr(χ21≤χ2)
where χ21 has a chi-square distribution with 1 degree of freedom.
p<α will reject the null hypothesis.

(2)SAS
McNemar’s Test
PROC FREQ computes McNemar’s test for 2 *2 tables when you specify the AGREE option. McNemar’s test is appropriate when you are analyzing data from matched pairs of subjects with a dichotomous (yes-no) response. It tests the null hypothesis of marginal homogeneity, or p1. = p.1. McNemar’s test is computed as
QM = (n12 - n21)^2/ (n12 + n21)
Under the null hypothesis, QM has an asymptotic chi-square distribution with one degree of freedom. See McNemar (1947), as well as the general references cited in the preceding section. In addition to the asymptotic test, PROC FREQ also computes the exact p-value for McNemar’s test when you specify the MCNEM option in the EXACT statement.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-10-30 23:45:56
从中应该注意三点:
(1)SPSS采用校正公式的切点为25而不是40,同时校正公式的条件为>25,与人卫版卫生统计学说到的条件方向(<40)相反,而<25时采用的是精确概率
(2)SAS中针对配对的四格表资料没有采用人卫版教材提到的校正公式,都统一采用的未校正的公式

(3)SPSS中在配对的四格表分析时是不会报道卡方值的,即使是当B+C>25时,也不会报道卡方值(大家可以尝试一下),只能报告P值。而SAS中报道的S统计量即为人卫版教材中所说的卡方值。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-3-17 13:27:47
moonstone 发表于 2013-10-30 23:45
从中应该注意三点:
(1)SPSS采用校正公式的切点为25而不是40,同时校正公式的条件为>25,与人卫版卫生统 ...
我正想办法找SAS有没有校正的统计量~在此学习了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群