McNemar (Concordence of paired proportions)
For instance, we could compare the results of 2 diagnostic methods on the same patients or the proportion of satisfaction before and after a certain treatment of change. We could for instance imagines paris of twins randomly assigned to a treatment and a control. In each group, the twin could either pass or fail a particular test.
mcnemar {stats}
- m is a 2x2 matrix of frequencies.
McNemar
M Claereboudt
December 26, 2015
The mcNemar test is a particular version of the Chi-square test designed to work on paired experimental subjects. Imagine that we have a class of 27 students and we ask them to take a “skill test” in Statistics just after and one week after viewing a tutorial video. The result of the test is a pass/fail mark. The question we would like to know is if there is a difference in skills after one week. We need first to create the data: After 1 Week After Pass Fail Pass 6 14 Fail 2 5 This can be interpreted as 6 students passed both tests, but 14 students passed immediately after the tutorial but failed to do so 1 week later. 2 students failed both times and 5 students actually passed one week later whereas they fail the first test.
datmc <- matrix(c(6,14,2,5), nrow = 2)
mcnemar.test(datmc)
##
## McNemar's Chi-squared test with continuity correction
##
## data: datmc
## McNemar's chi-squared = 7.5625, df = 1, p-value = 0.00596
The results of the tests suggest that indeed the passing and failing changes accroding to time (p-value = 0.00596). the distribution of pass and fail differs between the two exams: not very encouring from a pedagogical perspective.
In this second example, we keep the same number of students, but now the who succeeded both tests or failed both tests are much larger than the changes…. After 1 Week After Pass Fail Pass 16 3 Fail 5 3
datmc <- matrix(c(15,3,5,3), nrow = 2)
mcnemar.test(datmc)
##
## McNemar's Chi-squared test with continuity correction
##
## data: datmc
## McNemar's chi-squared = 0.125, df = 1, p-value = 0.7237
The results are now different. Most of the students passed both test, although some did improve over time… McNemar test tells us there is no significant difference in proportion over time.