McNemar’s test was first published in a Psychometrika article in 1947. McNemar’s test is given by Quinn McNemar, who was a professor in the Psychology and Statistics department at Stanford University. McNemar’s test is a non-parametric test that is used to compare two population proportions that are related or correlated to each other. McNemar’s test is also used when we analyze a study where subjects are accessed before and after the study. McNemar’s test is applied by a 2×2 contingency table with the dichotomous variable. McNemar’s test is also known as the test for marginal homogeneity for K×K table. For example, in medical research, if a researcher wants to determine whether or not a particular drug has an effect on a disease, then a count of the individuals is recorded (as + and – sign or 0 and 1) in a table before and after being given the drug. Then, McNemar’s test is applied to make statistical decisions as to whether or not a drug has an effect on the disease.
Procedure for McNemar’s test:
In McNemar’s, test data should be recorded in the following way:

In McNemar’s test, we assume that the row total is equal to the column total. In other words:
(A+B) = (A+C)
(C+D) = (B+D)
In this case, we will cancel the A and D equation and this implies that B=C, which is the basis of McNemar’s test. By using this equation, we will calculate the McNemar’s test as:
![]()
Here, chi-square statistics is with one degree of freedom.
Hypothesis in McNemar’s test:
Null hypothesis: In null hypothesis, McNemar’s test assumes that the total rows are equal to the sum of columns. The mean of paired samples are equal. In medical research, the null hypothesis assumes that the drug has no impact on disease.
Alternative Hypothesis: In McNemar’s test, the alternative hypothesis assumes that the total number of rows is not equal to the total number of columns, or the paired sample means are not equal. In medical research, alternative hypothesis assumes that the drug has an impact on the disease.
Significance testing: In McNemar’s test, significance is tested by using the chi-square table. McNemar’s test’s calculated value is compared with the chi-square table value. If the calculated value for McNemar’s test value is greater than the table value, we will reject the null hypothesis. If, however, the calculated value is less than the table value, we will accept the null hypothesis.
McNemar’s test in SPSS:
Most of the statistical software has an option for McNemar’s test. To perform McNemar’s test in SPSS, we have to follow the following procedures:
1.Start the SPSS by clicking it from the start menu.
2.Click on the “open data” icon and select the data.
3.Click on “non-parametric” from the analysis menu.
4.Select two-related samples from the non-parametric option. As we click on the two related samples, the following window will appear in front of us:

Select the paired variable (coded as dichotomous) and drag it to the right side of the variable list. Click on “option” and select “descriptive statistics” from there. Select “McNemar’s test” from the given test on the window. Click on the “ok” button and the result window will appear in front of us for McNemar’s test.
The result window will show the following table:

Descriptive statistics for McNemar’s test will show the statistics value for the total number of observations per variable, mean, SD, minimum and maximum value, etc.

This is the cross tab table for McNemar’s test. This table shows how many times the variable value of one crossed the variable value of two.

This table shows the test statistics for McNemar’s test. Significance value for McNemar’s test helps us in making a statistical decision. For example, if the significance value of McNemar’s test is less than the predetermined significance level, then we reject the null hypothesis and conclude that the difference between the two related samples is significant. If the significance value is greater than the predetermined significance level for McNemar’s test, then we will accept the null hypothesis and conclude that the difference between the two related samples is insignificant.


