数学いらずの医科統計学PART6 CHAPTER31をRでやってみる。
McNemar検定の話。
ケースとコントロールが一致した、134のサンプルを抽出した。
ケースとコントロールを対応させたままには、McNemar検定を使ってみる
data1 <- rbind(c(13, 4), c(25, 92)) mcnemar.test(data1) McNemar's Chi-squared test with continuity correction data: data1 McNemar's chi-squared = 13.7931, df = 1, p-value = 0.0002041
library(epibasix) mcNemar(data1, force=TRUE) Matched Pairs Analysis: McNemar's Chi^2 Statistic and Odds Ratio McNemar's Chi^2 Statistic (corrected for continuity) = 13.793 which has a p-value of: 0 McNemar's Odds Ratio (b/c): 0.16 95% Confidence Limits for the OR are: [-0.005, 0.39] summary(mcNemar(data1, force=TRUE)) Matched Pairs Analysis: McNemar's Statistic and Odds Ratio (Detailed Summary): Exposed Person: Disease Present Control Person: Disease Present 13 Control Person: Disease Absent 25 Exposed Person: Disease Absent Control Person: Disease Present 4 Control Person: Disease Absent 92 Entries in above matrix correspond to number of pairs. McNemar's Chi^2 Statistic (corrected for continuity) = 13.793 which has a p-value of: 0 Note: The p.value for McNemar's Test corresponds to the hypothesis test: H0: OR = 1 vs. HA: OR != 1 McNemar's Odds Ratio (b/c): 0.16 95% Confidence Limits for the OR are: [-0.005, 0.39] The risk difference is: -0.157 95% Confidence Limits for the rd are: [-0.238, -0.075]
p=0.0002である。帰無仮説は、母集団のオッズ比が1.0、である。
ケースでリスク(+)、コントロールでリスク(-)なら、うれしい・・・(1)
ケースでリスク(-)、コントロールでリスク(+)なら、まずい・・・(2)
合計をいじらずに、上のふたつを満たすには…と思って、(1)ケースでリスク(+)、コントロールでリスク(-)にの増分をつけると
(1)も(2)も両方増える。
は13まで増やせるけど、=13にしたところで、(1)のところが0というのは研究としてどうなのか…