McNemar’s Test Calculator (Paired 2×2, χ² With & Without Continuity Correction)

Test paired nominal shifts via McNemar’s χ², continuity-corrected χ², and matched Odds Ratio.

McNemar’s Chi-Square Statistic (df = 1) 8.526 χ²
Edwards Continuity-Corrected χ² 7.605 χ²_c
Matched-Pair Discordant Odds Ratio (b/c) 2.8 OR
Net Proportion Shift (b − c) / N 12 %
Inputs
Try:
cell b
Discordant pairs shifting Pre-Negative → Post-Positive (cell b).
cell c
Discordant pairs shifting Pre-Positive → Post-Negative (cell c).
a + d
Concordant pairs remaining unchanged (a + d).
Results & Graph
McNemar’s Chi-Square Statistic (df = 1)
8.526 χ²
Edwards Continuity-Corrected χ²
7.605 χ²_c
Matched-Pair Discordant Odds Ratio (b/c)
2.8 OR
Net Proportion Shift (b − c) / N
12 %

McNemar’s Chi-Square Statistic (df = 1)

Graph 1 • How the inputs feed McNemar’s Paired χ² Test
McNemar’s Paired Chi-Square Test (χ² = (b − c)²/(b + c)) & Exact Discordant Odds Calculator • Custom Domain Schematic (Non-Parametric & Hypothesis Testing) discordadiscordaMcNemar’s Paired χ² Te Discordant Neg To Pos Cell B: 28 cell b • Discordant Pos To Neg Cell C: 10 cell c MCNEMAR’S CHI-SQUARE STATI 8.526 χ² • Edwards Continuity-Cor: 7.605 χ²_c • Matched-Pair Discordan: 2.8 OR Eq: χ²_McNemar = (b − c)² / (b + c);
Graph 2 • McNemar’s Chi-Square Statistic (df = 1) as Discordant Neg To Pos Cell B changes (40% to 160% of current)
0 χ² 7.50 χ² 15.01 χ² 3.41 11.20 5.12 16.80 6.82 22.40 8.53 28 10.23 33.60 11.94 39.20 13.64 44.80
Graph 3 • Discordant Neg To Pos Cell B and Discordant Pos To Neg Cell C together Compares McNemar’s Chi-Square Statistic (df = 1) when Discordant Pos To Neg Cell C is shifted +25% (solid) vs. −25% (dashed).
0 χ² 6.10 χ² 12.19 χ² --- Discordant Pos To Neg Cell C @ 75% 5.97 -30% 7.25 -15% 8.53 +0% 9.80 +15% 11.08 +30%
Summary: With discordant pairs b=28 and c=10 (N=150), unadjusted McNemar χ² = 8.526, continuity-corrected χ² = 7.605, and matched Odds Ratio = 2.8.
Summary: With discordant pairs b=28 and c=10 (N=150), unadjusted McNemar χ² = 8.526, continuity-corrected χ² = 7.605, and matched Odds Ratio = 2.8.
Interactive chart & math engine powered by CalculatorGraph

Formula: McNemar’s Paired χ² Test Formula

χ²McNemar = (b − c)² / (b + c)
χ²Edwards = (|b − c| − 1)² / (b + c)
ORmatched = b / c
χ²_McNemar = (b − c)² / (b + c); χ²_Edwards = (|b − c| − 1)² / (b + c); OR_matched = b / c
  • discordantNegToPosCellB: Discordant Neg To Pos Cell B (cell b)
  • discordantPosToNegCellC: Discordant Pos To Neg Cell C (cell c)
  • concordantPairsAPlusD: Concordant Pairs A Plus D (a + d)

Frequently Asked Questions

How does the McNemar’s Paired Chi-Square Test (χ² = (b − c)²/(b + c)) & Exact Discordant Odds Calculator compute the solution?

It evaluates χ²_McNemar = (b − c)² / (b + c); χ²_Edwards = (|b − c| − 1)² / (b + c); OR_matched = b / c directly in your browser and updates three custom SVG visualizations in real time.

Why does the calculator ask for a plus d as a single number?

The concordant pairs are not used in either χ² or in the odds ratio, because a pair that did not change says nothing about direction. They only enter the net proportion shift, which divides b minus c by the total of all pairs. So the engine needs their sum, not the two cells separately. At the default, 112 concordant pairs give a total of 150 pairs.

How do I get a p value from the χ² shown?

Compare the statistic with the χ² distribution on one degree of freedom, using any statistics package or a χ² table. The two sided 0.05 cut off is 3.84, and 0.01 is about 6.63. The default unadjusted 8.526 works out to a p of about 0.0035, and the corrected 7.605 to about 0.0058. The page itself does not print a p value.

Which χ² should I put in my report?

Follow your field's convention or your analysis plan, and choose before you look at the result. Many authors report the uncorrected statistic with large counts and an exact test with small ones, using the corrected figure as a middle option. Whatever you pick, state which one it is, because readers cannot tell 8.526 and 7.605 apart without a label.

Why is the corrected χ² zero when b and c differ by one?

The Edwards correction subtracts 1 from the absolute difference between b and c before squaring. If that difference is exactly 1, the corrected numerator becomes zero. With b at 11 and c at 10, the uncorrected χ² is 0.048 and the corrected one is 0. Either way the conclusion is the same: there is no evidence of a directional shift.

What does a net proportion shift of 12% mean?

It is b minus c as a share of all pairs. At the default, 28 minus 10 is 18 more pairs moving positive than negative, out of 150 in total, so the overall positive rate rose by 12 percentage points between the two measurements. It is an effect size, separate from the significance test, and it shrinks if you add more concordant pairs.

Why is there no odds ratio when c is zero?

The matched odds ratio is b divided by c, and dividing by zero gives an infinite value, so the page leaves that line out rather than show a misleading figure. With b at 8 and c at 0 the χ² of 8 and corrected χ² of 6.125 are still valid, though an exact test is better with so few pairs. Describe the result as all eight changes going one way.

Can I use this for two raters judging the same cases?

Yes, if each case is rated by both raters on a yes or no scale and you want to know whether one rater says yes more often than the other. Put cases where rater one said no and rater two said yes in b, the reverse in c, and the agreements in a plus d. For agreement beyond chance, a kappa statistic answers a different question.

Does swapping b and c change the result?

The χ² values do not change, because the difference is squared. The odds ratio becomes its reciprocal and the net shift changes sign. Swapping the default cells gives the same 8.526 and 7.605, an odds ratio of 0.357 and a net shift of minus 12%. Check your cell labels so the direction you report matches what happened.

Can I enter percentages instead of counts?

No. McNemar's test is built on counts of pairs, and the χ² depends on how many there are. Entering 28 and 10 as percentages of some unknown total would give a statistic that has no meaning. Use the actual number of pairs that changed in each direction, which you get by cross tabulating the paired records.

Is the test valid with more than two outcome categories?

Not in this form. The calculator handles a 2×2 table: one yes or no outcome measured twice. For three or more categories measured in pairs, the extension is the Stuart Maxwell or Bowker test, which this page does not compute. Collapsing categories into two to fit this tool changes the question being asked.

Reading the default: 28 against 10 gives χ² of 8.526

The preset describes 150 paired observations. In 112 of them nothing changed: the before and after answers agreed. In 28 the answer went from negative to positive, which is cell b. In 10 it went from positive to negative, which is cell c.

From those counts the calculator reports an unadjusted McNemar χ² of 8.526 with one degree of freedom, an Edwards continuity corrected χ² of 7.605, a matched odds ratio of 2.8 and a net proportion shift of 12%.

You can check the main figure by hand. The difference between the discordant cells is 28 minus 10, which is 18. Square it and divide by the 38 discordant pairs and you get 8.526. For the corrected version, take 1 off the absolute difference first, so 17 squared over 38, which is 7.605. The odds ratio is 28 divided by 10. The net shift is 18 divided by all 150 pairs.

In plain terms: among the pairs that changed at all, nearly three moved in the positive direction for every one that moved the other way.

Why the 112 concordant pairs do not touch the test

McNemar's test looks only at pairs that disagree. A pair that was positive both times, or negative both times, tells you nothing about which direction change tends to go. So the χ² formula uses b and c and nothing else.

The concordant box matters for one output only: the net proportion shift, which divides b minus c by the total number of pairs. Raise the concordant count from 112 to five hundred and the χ² stays at 8.526, the corrected χ² stays at 7.605 and the odds ratio stays at 2.8, but the net shift falls from 12% to 3.346%.

That is a useful distinction when you report results. The χ² answers whether the change is lopsided. The net shift answers how big the change is across everyone studied. A study can have a highly significant McNemar test and a small net shift if most participants never changed at all.

The page asks for a plus d as one combined number for this reason. It does not need them separately for anything it calculates.

From χ² to a decision: the 3.84 line

The calculator gives the statistic but not a p value. With one degree of freedom, the usual reference point is 3.84, the χ² value that marks a two sided p of 0.05. A statistic above it is significant at that level; one below it is not. At the stricter 0.01 level the line is about 6.63.

Against those lines the presets sort cleanly. The default 8.526 corresponds to a p of roughly 0.0035, and the corrected 7.605 to roughly 0.0058, so both clear 0.01. The lower preset, with b at 17, gives 1.815 unadjusted and 1.333 corrected, well short of 3.84. The higher preset, with b at 42, gives 19.692 and 18.481, far past any conventional line.

Decide in advance which statistic you will report. Picking whichever one crosses 3.84 after seeing both is a quiet form of p hacking, and reviewers notice it when the two disagree.

Corrected or uncorrected: when the two disagree

The Edwards correction subtracts 1 from the absolute difference before squaring. Its job is to make the χ² approximation behave better when the discordant counts are small. The cost is that it is conservative: it makes the statistic smaller and the test harder to pass.

With large counts the two figures sit close together, as 19.692 and 18.481 do in the higher preset. With small counts they can land on opposite sides of 3.84. Take b at 20 and c at 10. The unadjusted χ² is 3.333 and the corrected one is 2.7. Neither passes. Now take b at 6 and c at 1: the unadjusted value is 3.571, the corrected one is 2.286, and an exact binomial test on those 7 discordant pairs gives a two sided p of 0.125. All three agree that 6 against 1 is not convincing evidence, but the uncorrected figure is the one that comes closest to suggesting otherwise.

When b and c differ by exactly 1, the engine's corrected χ² is 0. With b at 11 and c at 10 the uncorrected figure is 0.048 and the corrected one shows 0. That is the formula doing what it should: a difference of one pair is no evidence of direction at all.

Small discordant counts need the exact test

Both χ² versions rely on an approximation that works when b plus c is reasonably large. Many textbooks suggest switching to an exact binomial test once the discordant total drops into the low twenties or below. The exact test asks how likely a split at least as uneven as yours would be if each discordant pair were a coin toss.

This calculator does not run the exact test. It reports the two χ² versions and the odds ratio. For small samples you will need to do the binomial step elsewhere. For the default 28 against 10, the exact two sided p is about 0.0051, close to the χ² answer, because 38 discordant pairs is enough for the approximation to hold. For 17 against 10 the exact p is about 0.248, close to the corrected χ² p of about 0.248, and very different from a conclusion of significance.

A practical rule: when b plus c is small, report the exact p and treat the χ² figures as a sanity check rather than the result.

The matched odds ratio and what happens at zero

The matched odds ratio is simply b over c. At the default it is 2.8. Swap the cells, putting 10 in b and 28 in c, and it becomes 0.357, the reciprocal. The χ² does not change when you swap, because squaring removes the sign, but the net shift flips to minus 12%. Direction lives in the odds ratio and the net shift, not in the χ².

Zero cells need care. When c is zero the ratio b over c is infinite, so the page hides the odds ratio line rather than printing a made up number. With b at 8 and c at 0 you still get a χ² of 8 and a corrected χ² of 6.125, but no odds ratio. When b is zero and c is not, the ratio is a genuine 0. If both cells are zero, the page shows an error, because with no discordant pairs there is nothing to test.

No confidence interval is given for the odds ratio. If you need one, calculate it separately from b and c, and avoid quoting the ratio on its own when either cell is small.

Writing up 28 to 10 in a results paragraph

A McNemar result needs four things in a report: the discordant counts, the statistic and which version it is, the p value, and an effect size. The calculator supplies three of them directly. You add the p value.

For the default table a clear sentence would read something like this. Of 150 participants, 28 changed from negative to positive and 10 from positive to negative; McNemar's test with continuity correction gave χ² of 7.605 on one degree of freedom, p of about 0.006, with a matched odds ratio of 2.8 and a net increase of 12 percentage points.

Notice what that sentence avoids. It does not say the treatment caused the change, because a before and after design with no control group cannot show that on its own. It does not round the odds ratio up to 3, and it does not drop the counts in favour of percentages, which would hide how few pairs actually changed.

If the result is not significant, report it the same way. With b at 17 and c at 10 the corrected χ² is 1.333, which tells readers the shift could easily be chance. A missing result is harder to interpret than a reported null one, and the counts let others pool your data later.

Filling the 2×2 table correctly before you start

Most wrong McNemar results come from a wrong table, not wrong arithmetic. The test is for paired data: the same people measured twice, matched case and control pairs, or two raters judging the same items. Each pair contributes one count to exactly one of the four cells.

Cell b on this page is negative first and positive second. Cell c is positive first and negative second. If your software or paper lays out the table the other way round, the χ² will match but the odds ratio and net shift will flip direction, so check which way is which before reporting.

Do not enter the column or row totals into b and c. If 38 people were positive after and 20 before, those are margins, not discordant cells. You need the count of individuals who actually changed in each direction, which comes from the paired records, not from two summary percentages.

Independent groups belong to a different test. If the before and after samples are different people, McNemar's test is the wrong tool and the ordinary chi square test for a 2×2 table applies instead.