90
20
0.6111
0.5
-0.1111
-10
-0.5
5
4.05
90
20
0.6111
0.5
-0.1111
-10
-0.5
5
4.05
The McNemar's Test Calculator analyzes paired nominal data to test whether the row and column marginal frequencies are equal — essentially testing for a change in proportions for matched pairs. This test is commonly used in before-after studies, matched case-control designs, and diagnostic test comparisons on the same subjects.
Enter the four cells of your 2×2 matched-pairs table: concordant pairs (both positive or both negative) and discordant pairs (changes between conditions). The calculator computes both the corrected and uncorrected McNemar chi-square statistics.
McNemar's test focuses on the discordant pairs — cases where the two measurements disagree. In a before/after design:
| After + | After − | |
| Before + | a | b |
| Before − | c | d |
The null hypothesis is that the probability of changing from + to − equals the probability of changing from − to +, i.e., P(b) = P(c). The test statistic with continuity correction is:
$$\chi^2 = \frac{(|b - c| - 1)^2}{b + c}$$
Without continuity correction:
$$\chi^2 = \frac{(b - c)^2}{b + c}$$
This statistic follows a chi-square distribution with 1 degree of freedom under the null hypothesis. The continuity correction (subtracting 1 from |b − c|) improves the chi-square approximation for small discordant counts. For very small discordant totals (b + c < 25), an exact binomial test is preferable.
Only the discordant pairs (b and c) contribute information about the change — concordant pairs (a and d) provide no evidence about differential change rates.
Interpreting McNemar's test results:
Inputs
Results
90 patients tested before and after treatment. 15 improved → worsened, 5 worsened → improved. χ² = 4.05 > 3.841, indicating a significant change in proportions.
Inputs
Results
Two diagnostic tests on same patients. 8 vs 10 discordant — χ² = 0.056 << 3.841, no significant difference between the tests' positivity rates.
Use McNemar's test when: (1) You have paired or matched binary data, (2) The same subjects are measured at two time points (before/after), (3) Two diagnostic tests are compared on the same subjects, or (4) Matched case-control data need to be analyzed. The key requirement is that the data are dependent (paired), not independent.
Concordant pairs (both + or both −) provide no information about whether the marginal proportions differ. Only discordant pairs (b and c) contain information about the direction and extent of change. If b = c, the marginal proportions are exactly equal regardless of the concordant pair counts. This is analogous to how a paired t-test uses only the differences, not the original values.
The continuity correction subtracts 1 from |b − c| before squaring, compensating for using a continuous distribution to approximate a discrete statistic. Use it when the total number of discordant pairs is small (< 25). For larger discordant totals, the correction has minimal effect. Some statisticians always use the uncorrected version and rely on exact tests for small samples.
When b + c < 25 (or especially < 10), the chi-square approximation is unreliable. Use the exact binomial test instead: under H₀, b follows a Binomial(b+c, 0.5) distribution. Compute the two-sided p-value as the probability of observing b or a more extreme value under this binomial distribution.
McNemar's test is essentially a sign test applied to binary data. The sign test counts how many paired differences are positive vs. negative and tests whether the signs are equally likely. McNemar's test does the same for binary outcomes — counting b (changed in one direction) vs. c (changed in the other direction).
Yes. The Stuart-Maxwell test and Bhapkar's test generalize McNemar's test to k×k tables with more than two categories. For ordered categories, the sign test for matched pairs can be applied. These extensions test whether the marginal distributions differ across multiple paired categorical outcomes.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
P-Value Calculator
Statistical Inference & Hypothesis Testing
Confidence Interval Calculator
Statistical Inference & Hypothesis Testing
Margin of Error Calculator
Statistical Inference & Hypothesis Testing
Sample Size Calculator
Statistical Inference & Hypothesis Testing
Critical Value Calculator
Statistical Inference & Hypothesis Testing
Z-Test Calculator
Statistical Inference & Hypothesis Testing