McNemar Test Sample Size Calculator

Estimate matched-pair study sample size from discordant proportions. Adjust alpha, power, sidedness, dropout, and loss. See calculations before planning paired binary outcome studies carefully.

Calculator

Outcome changes from 0 to 1.

Outcome changes from 1 to 0.

Example Data Table

Scenario p01 p10 Alpha Power Dropout Continuity Approximate Use
Balanced pilot18%8%0.050.8010%YesBefore-after response study
Strict study16%7%0.010.9012%YesConfirmatory paired endpoint
Exploratory screen20%10%0.050.805%NoEarly planning estimate

Formula Used

The calculator uses a normal approximation for paired binary outcomes.

n = ((zalpha sqrt(p01 + p10) + zpower sqrt(p01 + p10 - (p01 - p10)2))2) / (p01 - p10)2

For two sided tests, zalpha uses 1 - alpha / 2. For one sided tests, it uses 1 - alpha. The continuity option adds a conservative reserve. Dropout divides the unadjusted sample by the analyzable pair rate.

How to Use This Calculator

  1. Enter p01 as the expected percentage changing from 0 to 1.
  2. Enter p10 as the expected percentage changing from 1 to 0.
  3. Select alpha, target power, and test sidedness.
  4. Choose whether to include continuity correction.
  5. Add expected dropout or unusable paired records.
  6. Click Calculate, Download CSV, or Download PDF.

Understanding McNemar Sample Size

McNemar studies use paired binary outcomes. Each subject gives two linked responses. The calculator focuses on discordant pairs because concordant pairs do not drive the test statistic. A large difference between p01 and p10 usually needs fewer paired observations. A small difference needs more observations.

Why Discordant Proportions Matter

The values p01 and p10 describe opposite changes. One may represent failure before treatment and success after treatment. The other may represent success before treatment and failure after treatment. Their sum estimates the discordant rate. Their difference estimates the paired effect. Power rises when the difference grows and the discordant rate remains practical.

Planning With Alpha and Power

Alpha controls the false positive risk. Power controls the chance of detecting the planned effect. A two sided design is stricter than a one sided design. It often needs more pairs. The tool uses a normal approximation for planning. It also reports expected discordant counts, adjusted pairs, achieved power, and the discordant odds ratio.

Continuity and Dropout

A continuity correction adds a conservative reserve. It is useful when expected discordant counts are small. Dropout adjustment inflates the final target. That helps protect power after missing visits, unusable records, or incomplete paired measurements. The adjusted total should be treated as the recruitment target.

Good Use Cases

This calculator supports matched case control studies, before after diagnostic studies, crossover screens, and paired classifier comparisons. It is most useful before data collection. Enter realistic values from pilot data, prior studies, or expert assumptions. Then compare several scenarios. Conservative planning avoids underpowered studies and expensive redesigns.

Limits

The result is an approximation. Very rare discordance, very small effects, or strict exact testing may need simulation or specialist software. Always document assumptions. Also keep ethical, clinical, and budget limits visible. A strong sample plan should be statistically clear and operationally possible.

Interpreting Results

The unadjusted total shows the mathematical minimum before loss. The final total includes dropout and rounding. Expected b and c counts help check whether assumptions are believable. If either count is very low, plan a sensitivity check. Review several p01 and p10 pairs. This reveals how fragile the design may be before recruitment begins. It also supports transparent protocol review later.

FAQs

What is a McNemar test sample size?

It is the number of paired observations needed for a McNemar test. The calculation focuses on discordant pairs because they contain the useful paired difference.

What does p01 mean?

p01 is the expected percentage moving from outcome 0 to outcome 1. It is one side of the discordant pair pattern.

What does p10 mean?

p10 is the expected percentage moving from outcome 1 to outcome 0. It is compared with p01 to estimate the paired effect.

Should I use a two sided test?

Use a two sided test when either direction matters. Use a one sided test only when the protocol supports one direction before data are seen.

Why add continuity correction?

Continuity correction makes the estimate more conservative. It can be useful when discordant counts may be small or when planning needs extra caution.

How should dropout be entered?

Enter the expected percentage of paired records lost or unusable. The calculator inflates the final recruited total to protect analyzable sample size.

Can concordant pairs affect the result?

Concordant pairs affect the total study work, but they do not drive the McNemar statistic. Discordant pairs carry the key test information.

Is this result exact?

No. It is an advanced normal approximation. Rare outcomes, tiny effects, or strict exact testing may require simulation or specialist review.

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.