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

MARKETING SCENARIOS

💼 Real Marketing McNemar Scenarios

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

INPUTS & SETTINGS

Select Data Entry Mode

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

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

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

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.

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

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

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

No raw file uploaded.

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. Darker cells indicate higher counts. The discordant pairs (b and c cells) drive the McNemar test—these are the "switchers" who changed their response between conditions.

Contingency Heatmap

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.

Summary Table

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

LEARNING RESOURCES

📚 When to use this test

Use McNemar's test when:

  • You have matched pairs of binary (yes/no) observations
  • The same subjects are measured under two different conditions
  • You want to test if the proportion of "positive" responses differs between conditions
  • Common examples: before/after studies, matched market tests, crossover designs

Why McNemar instead of Chi-Square?

Regular chi-square tests assume independent samples. McNemar's test accounts for the paired structure of your data, focusing only on the "discordant pairs" (subjects who switched their response between conditions).

⚠️ Common mistakes to avoid
  • Using chi-square for paired data: Regular chi-square ignores the matched structure and can give incorrect p-values.
  • Ignoring small sample sizes: When you have fewer than 25 discordant pairs, use the exact binomial test instead of the chi-square approximation.
  • Confusing cells: The "b" and "c" cells (discordant pairs) drive the test. The "a" and "d" cells (concordant pairs) don't contribute to the test statistic.
  • One-tailed vs. two-tailed: By default, McNemar's test is two-tailed. If you have a directional hypothesis, halve the p-value.
📐 How we calculate this (equations)

McNemar's test focuses on the "switchers"—pairs where the two conditions disagree:

\[ \begin{aligned} \chi^2_{\text{McNemar}} &= \frac{(b - c)^2}{b + c} \\[0.5em] \chi^2_{\text{Corrected}} &= \frac{(|b - c| - 1)^2}{b + c} \\[0.5em] p_{\text{exact}} &= 2 \times \min \left( \sum_{i=0}^{b} \binom{b + c}{i} 0.5^{b + c},\; \sum_{i=0}^{c} \binom{b + c}{i} 0.5^{b + c} \right) \end{aligned} \]

Where:

  • \(b\) = count of pairs where Condition A is positive but Condition B is negative
  • \(c\) = count of pairs where Condition A is negative but Condition B is positive
  • The continuity-corrected \(\chi^2\) controls Type I error when switchers are scarce
  • The exact test uses the binomial distribution and is preferred for small samples

Effect size (Odds Ratio):

\[OR = \frac{b}{c}\]

An OR > 1 means Condition A is more likely to produce positive outcomes; OR < 1 favors Condition B.

🔗 Related tools

DIAGNOSTICS & ASSUMPTIONS

Diagnostics & Assumption Tests

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