Proportions: Correlated and Paired
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.
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.
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.
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.
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.
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:
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.
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.