McNemar Test Sample Size Calculator

Plan matched binary outcome studies with practical power checks. Enter discordant rates and study assumptions. Export clear sample size summaries for reporting and review.

Calculator

Reset

Example Data Table

Scenario p10 p01 Alpha Power Correction Use case
Diagnostic comparison 18% 10% 0.05 80% Yes Two tests on the same subjects
Before and after study 22% 12% 0.05 90% Yes Matched response change
Pilot planning 14% 8% 0.10 80% No Early feasibility check

Formula Used

The calculator uses a normal approximation for McNemar matched pair sample size.

Without continuity correction: n = ((Zalpha + Zpower)^2 × (p10 + p01)) / (p10 - p01)^2

With continuity correction: n = ((Z × √s + √((Z^2 × s) + (4 × d))) / (2 × d))^2

Here, s = p10 + p01, d = |p10 - p01|, and Z = Zalpha + Zpower.

The final value is rounded up after minimum discordant checks, design effect, and dropout inflation.

How to Use This Calculator

  1. Enter p10 as the expected percentage for one discordant direction.
  2. Enter p01 as the expected percentage for the opposite direction.
  3. Choose alpha, target power, sided test, and correction choice.
  4. Add dropout and design effect when the study needs inflation.
  5. Press submit and read the result above the form.
  6. Download the CSV or PDF report for records.

McNemar Test Planning

McNemar analysis is used when each subject gives two related binary results. The pairs may be before and after a treatment. They may also be two diagnostic methods tested on the same person. The sample size depends on discordant pairs, not every pair. That makes planning different from an ordinary two proportion study.

Why Discordant Rates Matter

A paired table has four cells. Two cells agree. Two cells disagree. McNemar power mainly comes from the two disagreement cells. In this calculator, p10 means the expected proportion in the first discordant cell. The p01 value means the expected proportion in the opposite discordant cell. Their difference is the paired effect. Their sum is the discordant rate. A small sum means fewer useful disagreements. The study then needs more pairs.

Advanced Inputs

The tool accepts alpha, power, sided testing, continuity correction, dropout, and design effect. Alpha controls false positive risk. Power controls the chance of finding the planned paired difference. A two sided test is common when either direction matters. A one sided test is used only when the direction is fixed before data collection. Continuity correction is conservative. It often increases the required number of pairs.

Interpreting Results

The main result is the final number of matched pairs. This is not the number of observations in an unpaired design. Each pair belongs to one matched subject, unit, or cluster. The result also reports expected discordant counts. These counts help check whether the normal approximation is sensible. Very low discordant counts may require exact methods or simulation based planning.

Reporting the Plan

A good sample size statement should include all assumptions. Report p10, p01, alpha, target power, sided option, correction choice, dropout rate, and design effect. Also report the final rounded sample size. Keep the assumptions realistic. Prior pilot data is useful. Published paired studies can also guide the discordant rates.

Practical Use

Use several scenarios before committing to recruitment. Try optimistic, expected, and conservative values. Watch how the sample changes when the discordant sum falls. Also test higher dropout when follow up is difficult. This makes the plan stronger. It also helps reviewers see that the study design was planned with paired data in mind and clear goals.

FAQs

What is a McNemar test?

It is a paired test for two related binary outcomes. It checks whether the two discordant directions differ more than expected by chance.

What does p10 mean?

p10 is the expected percentage in one discordant direction. For example, method A may be positive while method B is negative.

What does p01 mean?

p01 is the expected percentage in the opposite discordant direction. The difference between p10 and p01 drives the effect size.

Should I use continuity correction?

Use it when you want a more conservative planning result. It often raises the estimated number of matched pairs.

Is the result subjects or observations?

The result is matched pairs. In many studies, one pair equals one subject measured twice or tested by two methods.

Can p10 and p01 sum above 100%?

No. They are parts of the same paired table. Their sum must be 100% or less.

Why include dropout?

Dropout protects the target power when subjects are lost, records are incomplete, or matched results cannot be analyzed.

When should I use exact methods?

Consider exact or simulation methods when expected discordant counts are low. The normal approximation may then be unstable.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.