McNemar Test for Paired Binary Data

The McNemar Test analyses paired binary data — typically the same subjects measured before and after an intervention with a yes/no outcome.


Step 1 — Choose input method

ModeWhat it does
Manual entryFill the four cells directly
UploadUpload Excel file with raw paired data

Sample Data Generator also available.


Step 2 — Enter the paired 2x2 table

CellSymbolMeaning
Before+/After+aStable positives
Before+/After-bLost positive (discordant)
Before-/After+cGained positive (discordant)
Before-/After-dStable negatives

The off-diagonal cells (b and c) are what McNemar tests.


Step 3 — Calculate

Results panel shows:

  • Chi-square statistic with df = 1
  • p-value (NEJM-style)
  • Continuity correction status
  • Odds Ratio (b/c) with 95% CI
  • Before proportion — (a+b)/N
  • After proportion — (a+c)/N
  • Discordant proportion — (b+c)/N
  • Sample size adequacy with power estimate

Step 4 — Multiple analyses

Each calculation logged with timestamp. Download Excel exports all analyses.

Materials and Methods block provides auto-generated text.

A UniversalChatBot is available below.


Statistical methods used

Test statistic — adaptive continuity correction

ConditionFormula
b+c < 25`chi2 = (
b+c >= 25chi2 = (b-c)^2 / (b+c) (without correction)
b+c = 0chi2 = 0, p = 1

Hypothesis statement

  • H0: Marginal proportions are equal (b = c)
  • H1: Marginal proportions differ (two-tailed)
  • alpha = 0.05

Odds Ratio (paired)

OR = b / c with SE_logOR = sqrt(1/b + 1/c).

Sample adequacy

  • Total N >= 30
  • Discordant pairs (b+c) >= 10
  • Estimated power >= 0.80