Statistical Calculators › Proportions: Correlated and Paired › McNemar’s Test Sample Size
← All Calculators

Proportions: Correlated and Paired

McNemar's Test Sample Size

Calculate the required number of matched pairs for a McNemar test of paired binary proportions using the normal-approximation sample-size formula described by Connor (1987). Enter the expected proportions of pairs that switch in each direction, along with alpha and desired power.

Study Design

Enter the expected discordant-pair proportions. Concordant pairs do not contribute directly to McNemar's test statistic.
P10 + P01 is the expected proportion of discordant pairs. The two probabilities must sum to less than 1.

Sample Size Result

The displayed sample size is the next whole number at or above the unrounded normal-approximation result.
Enter the study assumptions and click Calculate Sample Size.

Methodology

McNemar's test compares two correlated binary responses, such as a before/after outcome on the same subject or two binary classifications made on a matched pair. The null hypothesis is that the two discordant probabilities are equal: P10 = P01. Only the discordant pairs enter the test statistic directly; concordant pairs contribute to the total sample size but not to the observed directional difference.

Sample Size Formula

This calculator uses the normal-approximation formula presented by Connor (1987). Let P10 be the expected proportion of pairs with a positive response under the first condition and a negative response under the second, and let P01 be the expected proportion with a negative response under the first condition and a positive response under the second.

PD = P10 + P01
D = P10 − P01

N = [ z1−&alpha/s√(PD) + z1−&beta√(PD − D2) ]2 / D2

Here, s is 2 for a two-sided test and 1 for a one-sided test, α is the Type I error rate, β = 1 − power, and zq is the q-th standard-normal quantile. The required number of matched pairs is rounded up to the next whole pair.

Why P10 and P01 Matter

The effect being tested is the imbalance between the two directions of disagreement. If P10 and P01 are close, D is small and the required sample size increases. The total discordance PD also affects the calculation because McNemar's information comes from the discordant pairs.

Worked Example

Suppose 20% of matched pairs are expected to switch from positive to negative (P10 = 0.20) and 8% from negative to positive (P01 = 0.08). For a two-sided test with α = 0.05 and 80% power:

PD = 0.20 + 0.08 = 0.28
D = 0.20 − 0.08 = 0.12
z0.975 = 1.959964
z0.80 = 0.841621

N = 150.2375 → 151 matched pairs

This example is an implementation check for the calculator: the unrounded result is approximately 150.2375 and the displayed required sample size is 151 pairs.

Interpretation

References

Connor, R. J. (1987). Sample size for testing differences in proportions for the paired-sample design. Biometrics, 43(1), 207–211. PMID 3567305.

NCSS, LLC. PASS Sample Size Software: Tests for Two Correlated Proportions (McNemar Test), Chapter 150. The PASS documentation describes McNemar's test for paired binary outcomes, its off-diagonal probabilities P10 and P01, the conditional normal approximation, and the alternative exact multinomial-enumeration method.