McNemar test

Command: Statistics
Next selectCrosstabs
Next selectMcNemar test


The McNemar test is a test on a 2x2 classification table when you want to test the difference between paired proportions, e.g. in studies in which patients serve as their own control, or in studies with "before and after" design.

In the McNemar test dialog box, two discrete dichotomous variables with the classification data must be identified. Classification data may either be numeric or alphanumeric (string) values. If required, you can convert a continuous variable into a dichotomous variable using the Create groups tools. The variables together cannot contain more than 2 different classification values.

For example, in a study a test is performed before treatment and after treatment in 20 patients. The results of the test are coded 0 and 1. Is there a significant change in the test result before and after treatment?

How to enter the data in the spreadsheet

McNemar test

Required input

The dialog box for the McNemar test is completed as follows:

McNemar test

After you have completed the dialog box, click the OK button to obtain the classification table with the relevant statistics.

McNemar test

Classification table

The program displays the 2x2 classification table.

Difference and P-value

The program gives the difference between the proportions (expressed as a percentage) with 95% confidence interval.

When the (two-sided) P-value is less than the conventional 0.05, the conclusion is that there is a significant difference between the two proportions.

In the example, the difference before and after treatment is 10% with 95% CI from -11.86% to 18.35%, which is not significant (P=0.625, n =20).


If the number of discordant pairs (3 + 1 in the example) is less than or equal to 25, then the two-sided P-value is based on the cumulative binomial distribution. If the number of discordant pairs is more than 25 then a Chi-squared approximation with Yates' correction for continuity is used.

The 95% confidence interval is calculated according to Bland, 2000.


  • Altman DG (1991) Practical statistics for medical research. London: Chapman and Hall.
  • Bland M (2000) An introduction to medical statistics, 3rd ed. Oxford: Oxford University Press.

See also

External links

Privacy Contact Site map