library(epibasix)
<- table(colds$age12, colds$age14)
X <- mcNemar(X)
epi_mcn summary(epi_mcn)
Matched Pairs Analysis: McNemar's Statistic and Odds Ratio (Detailed Summary):
No Yes
No 707 256
Yes 144 212
Entries in above matrix correspond to number of pairs.
McNemar's Chi^2 Statistic (corrected for continuity) = 30.802 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): 1.778
95% Confidence Limits for the OR are: [1.449, 2.208]
The risk difference is: 0.085
95% Confidence Limits for the rd are: [0.055, 0.115]