McNemar's test is used when you have paired or matched binary data — for example, the same subjects measured before and after an intervention. Unlike the standard chi-square test (which assumes independent observations), McNemar's test accounts for the pairing by focusing only on the "discordant" cells where subjects changed category.
For a paired 2×2 table with discordant cells b and c:
Use McNemar's test for:
CrossTabs.com computes three versions: (1) the standard chi-square approximation, (2) Yates' continuity-corrected version for small samples, and (3) the exact binomial test which makes no distributional assumptions. The exact test is recommended when b + c < 25.
The standard chi-square test assumes independent observations. McNemar's test is for paired/matched data where the same subjects are measured twice. Using chi-square on paired data violates the independence assumption and gives invalid results.
In a before-after 2×2 table, discordant cells are where subjects changed: positive→negative or negative→positive. Concordant cells (no change) are ignored by McNemar's test because they provide no information about differential change.
The standard McNemar test is for 2×2 tables. For larger tables with more categories, use the Bowker test of symmetry or the Stuart-Maxwell test, which generalize McNemar's to R×R tables.