Exercise

Comparing two proportions for paired samples (4)

Of course there are convenience functions in R available that make it easier to perform a McNemar test. The function is conveniently called mcnemar.test(). This functions takes a two-dimensional contingency table in matrix form. This test then calculates a chi-square and outputs a p value. An example of using the mcnemar.test() function is the following: mcnemar.test(matrix)

Instructions

100 XP
  • Saved in your console is a contingency matrix called europe. Perform the McNemar test on this matrix and print the results to the console.