McNemar Test Explorer

Decision-First Design Matched Pairs

Compare matched binary outcomes with clear decision indicators, confidence intervals, and business-ready reporting.

πŸ‘¨β€πŸ« Professor Mode: Guided Learning Experience

New to paired categorical tests? Enable Professor Mode for step-by-step guidance through McNemar's test for matched-pair data!

QUICK START: Choose Your Path

DATA SOURCE

πŸ“š

Use a Case Study

💼 Real Marketing McNemar Scenarios

Select a preset scenario to explore real-world matched-pair comparisons with authentic marketing metrics and business context.

πŸ“€

Upload Your Data

Upload a file to populate the table above β€” row-level raw data or a pre-summarized file.

Upload row-level matched outcomes. Each row should contain Condition A and Condition B outcomes.

Drag & Drop raw data file (.csv, .tsv, .txt, .xls, .xlsx)

Two columns with headers (Condition A, Condition B); entries can be text labels or 0/1 outcomes.

No raw file uploaded.

Upload a single-row CSV with condition labels, outcome labels, and the four cell counts.

Drag & Drop summary file (.csv, .tsv, .txt, .xls, .xlsx)

One header row + one data row with columns for labels and counts (a_positive_b_positive, a_positive_b_negative, a_negative_b_positive, a_negative_b_negative).

No summary file uploaded.

INPUTS & SETTINGS

Matched Outcome Table

πŸ“Š What goes in each cell?

Cell a: Subjects positive on both conditions (concordant)
Cell b: Positive on A, Negative on B (switcher β†’)
Cell c: Negative on A, Positive on B (← switcher)
Cell d: Subjects negative on both conditions (concordant)

Key insight: McNemar's test only uses the highlighted switcher cells (b and c). The concordant cells (a and d) don't affect the test statistic.

Enter counts for each combination. Highlighted cells are the "switchers" that drive the test.

Condition B Positive
  Negative
Condition A Positive
a
Both positive
b
Switcher →
  Negative
c
← Switcher
d
Both negative
Row 1 Total 0
Row 2 Total 0
Total Pairs 0

Confidence Level & Reporting

Set the significance level for all McNemar reporting.

Analysis Settings

Stay with the default unless your testing doc specifies otherwise.

Statistic guidance

  • Chi-square (corrected): default, controls false positives when switchers are scarce.
  • Chi-square (no correction): use when you have 25+ switchers and want slightly more power.
  • Exact binomial: safest when you have only a handful of switchers.
Advanced: Override the statistic

YOUR DECISION

⏳

Enter data to see your result

We'll test if conditions differ in their success rates

VISUAL OUTPUT

📊 How to read these charts

The contingency heatmap shows your 2×2 table visually, explicitly distinguishing concordant (no-change) cells from the discordant switcher cells (b and c) that drive the test. The switcher & marginal shift chart below visualizes how those switchers split relative to the 50/50 symmetry null or compares total positive rates across conditions.

Contingency Heatmap

Discordant Switcher Split vs. 50% Null

TEST RESULTS

πŸ’‘ How to Interpret These Results

Reading the p-value and test statistic:

  • McNemar χ²: Measures the magnitude of asymmetry between discordant pairs. Larger values = stronger evidence that conditions differ.
  • p < 0.05: Strong evidence that the proportion of "positive" outcomes differs between conditions. Reject \(H_0\) (no difference).
  • p β‰₯ 0.05: Insufficient evidence. Cannot conclude conditions produce different success rates.
  • Very small p (< 0.001): Very strong evidence. The difference between conditions is highly unlikely due to chance.

Understanding the Odds Ratio (OR):

  • OR = b/c where b and c are the discordant pair counts
  • OR > 1: Condition A produces more "positive β†’ negative" switches than Condition B (A favors positive outcomes)
  • OR < 1: Condition B produces more "negative β†’ positive" switches (B favors positive outcomes)
  • OR β‰ˆ 1: No meaningful difference between conditions
  • The confidence interval shows the plausible range for the true OR. If it excludes 1, the difference is significant.

Understanding the 2Γ—2 table cells:

  • Cell a (both positive): Same subjects responded "positive" under both conditions. Concordant – does NOT drive the test.
  • Cell d (both negative): Same subjects responded "negative" under both conditions. Concordant – does NOT drive the test.
  • Cell b (A+, Bβˆ’): Subjects who were positive under Condition A but negative under Condition B. Discordant "switcher".
  • Cell c (Aβˆ’, B+): Subjects who were negative under Condition A but positive under Condition B. Discordant "switcher".

McNemar's test only uses cells b and c. A significant result means "switching" is not symmetricβ€”one condition outperforms the other.

Which method should I use?

  • Chi-square (corrected): Default choice. Reduces false positives when discordant pairs (b + c) are small (< 25).
  • Chi-square (no correction): Slightly more power when b + c β‰₯ 25. Use if you have plenty of switchers.
  • Exact binomial: Safest for very small samples (b + c < 10). Computes exact probability.
Method: –
Test statistic: –
Degrees of freedom: 1
p-value: –
Odds ratio (CI): –
Decision (α): –
Interpretation: –

APA-Style Statistical Reporting

Managerial Interpretation

Switcher Narrative

McNemar Test Output

Enter paired counts to run the test.

3-Method Comparison (Continuity-Corrected vs. Uncorrected vs. Exact Binomial)

See how all three McNemar test formulations evaluate your discordant switcher counts (\(b\) vs. \(c\)) side-by-side.

Method Test Statistic Two-Sided p-value Conclusion at α Recommended When
Enter counts to compare methods.

Summary Table

Cell Count Share of total Notes
Enter counts to see the full table.

OVERVIEW & WHAT THIS TOOL SOLVES

When you measure the same customers twice on a Yes/No outcomeβ€”such as brand awareness before vs. after an ad campaign, or purchase intent when shown Creative A vs. Creative Bβ€”a standard two-sample chi-square or z-test is invalid because the observations are paired. McNemar's Test for Paired Binary Data isolates the "switchers" (customers who changed from No to Yes versus Yes to No) to test whether a campaign or design change caused a statistically significant net shift in binary response.

🎯 Questions It Answers

  • Did a campaign or product experience cause a significant net shift in Yes/No response within the same respondents?
  • Among customers who changed their mind (discordant pairs), did significantly more switch in the positive direction than the negative?
  • Do the Classical asymptotic test, Edwards continuity-corrected test, and Exact Binomial test agree on our sample?

πŸ“‚ What Data You Need

  • 2Γ—2 Paired Contingency Counts: Concordant Yes/Yes (a), Switchers Yesβ†’No (b), Switchers Noβ†’Yes (c), Concordant No/No (d)
  • Or Raw Paired CSV: One row per subject with binary columns for Condition A and Condition B
  • Discordant Count Check: Sum of switchers (b + c) determines statistical power

πŸ’‘ What You'll Discover

  • Net Marginal Lift: Percentage-point shift between Condition A and Condition B with 95% confidence interval
  • Discordant Odds Ratio (c / b): Ratio of positive switchers to negative switchers
  • 3-Method Comparison Table: Side-by-side results for Classical χ², Continuity-Corrected χ², and Exact Binomial p-values
πŸ” Key Nuances & Common Traps to Watch For
  • Only Switchers Drive the Test: Respondents who answered Yes both times (cell a) or No both times (cell d) provide context on overall baseline rates, but McNemar's test statistic depends entirely on the discordant switchers (b and c).
  • When to Trust Exact Binomial Over Chi-Square: When total switchers are small (b + c < 25), the chi-square approximation can be inaccurate. Always rely on the Exact Binomial p-value for small discordant counts.
  • Why Standard Chi-Square Fails Here: Running a standard 2Γ—2 chi-square test of independence on pre/post data treats the same person measured twice as two strangers, throwing away within-person pairing and losing statistical power.
πŸ“ Under the Hood: Model Equations & Variable Definitions

1. Classical & Edwards Continuity-Corrected McNemar Chi-Square

\[ \chi^2_{\text{McNemar}} = \frac{(b - c)^2}{b + c}, \qquad \chi^2_{\text{Corrected}} = \frac{(|b - c| - 1)^2}{b + c} \quad (\text{df} = 1) \]

πŸ’¬ Read it in plain English: McNemar's statistic squares the net imbalance between the two switcher cells (b and c) and divides by the total number of switchers; Edwards's correction subtracts 1 from the numerator gap so the continuous chi-square curve better matches discrete headcounts.

a, d
Concordant Pairs (Yes/Yes & No/No)YOUR DATA β“˜
Subjects whose binary outcome did not change between Condition A and Condition B.
b
Discordant Pairs (+ β†’ βˆ’)YOUR DATA β“˜
Count of subjects who were Positive under Condition A but switched to Negative under Condition B.
c
Discordant Pairs (βˆ’ β†’ +)YOUR DATA β“˜
Count of subjects who were Negative under Condition A and switched to Positive under Condition B.
Ο‡2McNemar
Asymptotic McNemar StatisticINFERENCE β“˜
Uncorrected chi-square statistic (df = 1) testing Hβ‚€: p_b = p_c.
Ο‡2Corrected
Edwards Continuity-Corrected χ²INFERENCE β“˜
Continuity-corrected chi-square statistic that reduces false positives in moderate samples.

2. Exact Binomial Test & Discordant Odds Ratio

\[ p_{\text{exact}} = 2 \sum_{k=0}^{\min(b,c)} \binom{b+c}{k} (0.5)^{b+c}, \qquad \text{OR}_{\text{McNemar}} = \frac{c}{b} \]

πŸ’¬ Read it in plain English: Under the null hypothesis of no net shift, every switcher is a 50/50 coin flip between b and cβ€”the exact binomial test sums those exact coin-flip probabilities, while the discordant odds ratio (c / b) tells you how many times more likely a switcher was to move positive than negative.

pexact
Two-Sided Exact Binomial p-ValueINFERENCE β“˜
Exact two-tailed probability from Binomial(n = b + c, p = 0.5), capped at 1.0.
ORMcNemar
Discordant Odds RatioOUTPUT β“˜
Ratio of positive switchers to negative switchers (c / b); OR = 1.0 indicates symmetric switching.
b + c
Total Discordant SwitchersYOUR DATA β“˜
Effective sample size of switchers governing the power of McNemar’s test.
(c βˆ’ b) / N
Net Marginal Proportion ShiftOUTPUT β“˜
Difference between Condition B positive rate (a + c)/N and Condition A positive rate (a + b)/N.

DIAGNOSTICS & ASSUMPTIONS

Diagnostics & Assumption Tests

Run an analysis to populate diagnostics on switcher counts, balance, and assumption risk.