Tests for paired proportions
Related functions
help.search("McNemar")
exact2x2::exactMcNemar Exact McNemar's Test
epibasix::mcNemar Pair-Matched Analysis Tool
exact2x2::exact2x2CI Internal functions for exact2x2. Not to be called by user.
exact2x2::exact2x2 Exact Conditional Tests for 2 by 2 Tables of Count Data
RcmdrPlugin.EZR::EZRdialogs EZR dialogs
stats::mcnemar.test McNemar's Chi-squared Test for Count Data
Load packages
library(exact2x2)
Prepare data
## Agresti (1990), p. 350.
## Presidential Approval Ratings.
## Approval of the President's performance in office in two surveys,
## one month apart, for a random sample of 1600 voting-age Americans.
Performance <-
matrix(c(794, 86, 150, 570),
nrow = 2,
dimnames = list("1st Survey" = c("Approve", "Disapprove"),
"2nd Survey" = c("Approve", "Disapprove")))
Performance
## 2nd Survey
## 1st Survey Approve Disapprove
## Approve 794 150
## Disapprove 86 570
McNemar tests
## Approximation test
mcnemar.test(Performance)
##
## McNemar's Chi-squared test with continuity correction
##
## data: Performance
## McNemar's chi-squared = 16.82, df = 1, p-value = 0.00004115
## Exact test
mcnemar.exact(Performance)
##
## Exact McNemar test (with central confidence intervals)
##
## data: Performance
## b = 150, c = 86, p-value = 0.00003716
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.329 2.301
## sample estimates:
## odds ratio
## 1.744