Sample Size Calculator

Paired proportions

Determines the sample size required to detect a specified difference in paired binary outcomes, accounting for the dependence between matched observations using McNemar's test.

Key takeaways

  • What is calculated: Determine the number of pairs at which the McNemar test attains the target power.
  • Quantities you must supply: Proportion of discordant pairs; Odds ratio of discordance; Significance level; Power.
  • Type of calculation: Power-based: it answers how much data is needed to detect a stated effect. Power 0.80 at α = 0.05 is the usual target; confirmatory studies use 0.90.

Method used for Paired proportions

  • McNemar's test for paired proportions (Connor) Sample size for paired binary outcomes, driven entirely by the discordant pairs. Pairing removes between-subject variation, and the McNemar test conditions on the discordant pairs to exploit it.

When to use

Use when the primary objective is to determine whether there is a meaningful difference in paired binary outcomes, such as the proportion positive before and after an intervention in the same individuals.

Sample size

Ratio of the two discordant cell probabilities; must not equal 1.

Type I error rate.

Probability of detecting the specified effect.

A two-sided alternative splits α between both tails; a one-sided alternative places all of α in one tail, needs a smaller n, and must be pre-specified.

Final n is inflated by 1/(1 − dropout).

Reset to defaults

Awaiting inputs

Set the parameters and calculate.

Methodology — McNemar's test for paired proportions (Connor)

Formula used McNemar's test for paired proportions (Connor)

n=[z1α/2(ψ+1)+z1β(ψ+1)2(ψ1)2πd]2(ψ1)2πd
Number of pairs
  • z1α/2(two-sided)in place ofz1α(one-sided) Two-sided alternative selected: α is split between both tails, so the larger quantile is used and the requirement rises

where —

π_d
Proportion of pairs expected to be discordant. Typically 0.10 – 0.40
ψ
Ratio of the discordant cell probabilities — the matched odds ratio. > 0; must differ from 1
α
Probability of rejecting a true null hypothesis (Type I error). 0.0001 – 0.5; conventionally 0.05, or 0.025 one-sided for regulatory non-inferiority
1 − β
Probability of rejecting the null hypothesis when the specified alternative is true. 0.50 – 0.9999; conventionally 0.80 or 0.90
Expected proportion of enrolled units lost before analysis. 0 – 0.95

How this method works

In paired binary data only the discordant pairs — where the two members disagree — carry information about a difference. Concordant pairs contribute nothing to the McNemar statistic, so the calculation depends on the discordant proportion and the ratio of the two discordant cells.

For paired binary data only the discordant pairs carry information; concordant pairs contribute nothing to the McNemar statistic.

π_d is the parameter most often guessed badly. It cannot be derived from the marginal proportions alone and generally needs pilot data. Underestimating it inflates n, which is the safe direction.

Null hypothesis. H0: the two discordant cell probabilities are equal (psi = 1).

Alternative hypothesis. Two-sided H1: psi != 1. One-sided H1: psi > 1 or psi < 1.

Calculation procedure

  1. Work out how often the two tests, or the two occasions, are expected to disagree: the discordant proportion pd.
  2. Split those disagreements: ψ is the share falling in one direction rather than the other. Only these pairs carry information.
  3. Take z1α/2 and z1β.
  4. Compute the discordant pairs needed, nd=[z1α/2+2z1βψ(1ψ)]2(2ψ1)2.
  5. Convert to pairs enrolled, n=nd/pd, round up, then inflate for dropout.

Exact or approximate

Approximate — a normal approximation conditional on the discordant pairs. An exact conditional binomial test is preferable when the expected number of discordant pairs is small.

The formula shown always matches what was computed: when a one-sided test is selected the rendered quantile changes from z1−α/2 to z1−α, and where several methods exist, the formula follows the method selected in the calculator.

Advantages & limitations

Advantages

  • Correctly exploits the pairing.
  • Requires fewer subjects than an unpaired design when pairing is effective.
  • Controls for stable subject characteristics by design.

Limitations

  • Requires the discordant proportion, which cannot be derived from the marginal proportions and usually needs pilot data.
  • Underestimating the discordant proportion inflates n — the safe direction; overestimating underpowers the study.
  • Loss of either pair member removes the whole pair.

Assumptions

  • Pairs are independent of one another.
  • Pairing is determined by design, not chosen after seeing the outcome.
  • The discordant proportion is correctly specified.
  • Expected discordant counts are large enough for the normal approximation.

Applicable adjustments

Supports dropout inflation, which should be specified at the pair level.

Conclusion

Report the number of pairs together with the assumed discordant proportion and odds ratio. State how the discordant proportion was obtained, since it is the parameter most often guessed badly.

References

  1. Connor RJ. Sample size for testing differences in proportions for the paired-sample design. Biometrics. 1987;43(1):207–211. Link
  2. Miettinen OS. The matched pairs design in the case of all-or-none responses. Biometrics. 1968;24(2):339–352. Link
  3. Fleiss JL, Levin B, Paik MC. Statistical Methods for Rates and Proportions. 3rd ed. Hoboken: Wiley; 2003.