How to use this calculator
Compare paired binary outcomes using only subjects whose before-and-after responses disagree.
- Enter Changed from no to yes, Changed from yes to no. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Exact McNemar discordant pairs test explained
Use the two discordant cells of a paired binary study to calculate the exact two-sided McNemar p-value and a continuity-corrected chi-square statistic.
How the calculation works
Under the paired null, B∼Binomial(b+c,0.5); corrected χ²=max(0,|b−c|−1)²/(b+c).
Each person supplies a matched pair, not two independent observations. Concordant yes/yes and no/no pairs contribute no directional evidence to McNemar’s test. The exact two-sided result sums binomial outcomes no more probable than the observed split.
Set up the calculation
b— Changed from no to yes- Number of matched subjects who move from no to yes. Include only this discordant direction. Enter a whole number.
c— Changed from yes to no- Number of matched subjects who move from yes to no, using the same pair orientation as b. Enter a whole number.
Limits of this model
Require independent pairs and 1–20,000 discordant pairs. Subjects must not appear in more than one pair. The chi-square result is an approximation; the main p-value is exact.
Check this example
Changed from no to yes = 11; Changed from yes to no = 3.
- Exact two-sided paired p-value: 0.0573730469
- Continuity-corrected chi-square: 3.5
- Discordant pairs: 14 pairs
Eleven subjects switch toward yes and three toward no, so the null binomial experiment has fourteen trials. Adding fifty unchanged pairs would leave this test result unchanged.
Reading the outputs
The exact p-value addresses directional symmetry among discordant pairs. The corrected statistic is provided for comparison with asymptotic software output.
Frequently asked questions
Where do unchanged subjects go?
They are omitted from these two inputs because they do not affect the discordant-pair test.
Can I compare two independent customer groups?
Use an independent-proportions or contingency-table test instead.
What if b+c is zero?
There is no directional information; the calculator asks for at least one discordant pair.
How do I use the Exact McNemar discordant pairs test calculator?
Enter Changed from no to yes, Changed from yes to no. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Exact McNemar discordant pairs test?
Changed from no to yes = 11; Changed from yes to no = 3. Exact two-sided paired p-value: 0.0573730469 Continuity-corrected chi-square: 3.5 Discordant pairs: 14 pairs Eleven subjects switch toward yes and three toward no, so the null binomial experiment has fourteen trials. Adding fifty unchanged pairs would leave this test result unchanged.
Method reference: Statsmodels exact McNemar test.