McNemar’s test was first published in a Psychometrika article in 1947. It was created 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. This test is also used when we analyze a study where subjects are tested before and after time periods. It is applied by a 2×2 contingency table with the dichotomous variable. It 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:

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. By using this equation, we will calculate the test as:
![]()
Here, chi-square statistic has with one degree of freedom (df).
Hypothesis:
Null hypothesis: Assumes that the total rows are equal to the sum of columns. The mean of paired samples are equal. In medical research, for example, the null hypothesis assumes that the drug has no impact on disease.
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, for example, alternative hypothesis assumes that the drug has an impact on the disease.
Significance testing: Significance is tested by using the chi-square table. The calculated value is compared with the chi-square table value. If the calculated value for McNemar’s test value is greater than occur to 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.
SPSS:
To perform McNemar’s test in SPSS, follow the following procedures:
- Start the SPSS by clicking it from the start menu.
- Click on the “open data” icon and select the data.
- Click on “non-parametric” from the analysis menu.
- 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.
The result window will show the following table:

Descriptive statistics 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, 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 helps us in making a statistical decision. For example, if the significance value 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, then we will accept the null hypothesis and conclude that the difference between the two related samples is insignificant.
Related Pages:



