Statistics Definitions > McNemar Test Example
What is the McNemar Test?
The McNemar test is a nonparametric test for paired nominal data. It’s used when you are interested in finding a change in proportion for the paired data. For example, you could use this test to analyze retrospective casecontrol studies, where each treatment is paired with a control. It could also be used to analyze an experiment where two treatments are given to matched pairs. This test is sometimes referred to as McNemar’s ChiSquare test because the test statistic has a chisquare distribution.
Assumptions for the McNemar Test
The three main assumptions for the test are:
 You must have one nominal variable with two categories (i.e. dichotomous variables) and one independent variable with two connected groups.
 The two groups in your the dependent variable must be mutually exclusive. In other words, participants cannot appear in more than one group.
 Your sample must be a random sample.
If your data does not meet these three assumptions, considering running another test for your data like a regular chisquare test.
Calculating the Test
In order to run a McNemar test, your data should be placed into a 2×2 contingency table, with the cell frequencies equaling the number of pairs. For example, a researcher is testing a new medication and records if the drug worked (“yes”) or did not (“no”). A table is set up with the count of individuals before and after being given the medication. The cell labels ad are in blue:
Cells b and c are used to calculate the test statistic; these cells are called “discordant.”
The McNemar test formula is:
For the set of data above, we have:
= (10010)^{2} / (100 + 10)
= 90^{2} / 100
= 73.63
You have several options for calculating the McNemar test using technology:
 This online calculator will calculate the McNemar test using inputs for any 2×2 contingency table that you provide input for.
 SPSS: The binomial distribution is used for the McNemar test. You can find excellent instructions here on the SFU website.
 SAS instructions can be found here on the Purdue website.


Need help with a homework or test question? With Chegg Study, you can get stepbystep solutions to your questions from an expert in the field. Your first 30 minutes with a Chegg tutor is free!
Statistical concepts explained visually  Includes many concepts such as sample size, hypothesis tests, or logistic regression, explained by Stephanie Glen, founder of StatisticsHowTo.
Comments? Need to post a correction? Please post a comment on our Facebook page.