McNemar Test Calculator

Test paired binary categorical changes with exact binomial or continuity-corrected chi-square McNemar test

Example Results

1 examples

Test before-after binary change

Use McNemar test to evaluate whether paired yes/no responses changed asymmetrically

{
  "result": {
    "discordantPairs": 15,
    "exactPValue": 0.0352,
    "pValue": 0.0352,
    "rejectNull": true
  }
}
View input parameters
{ "beforeYesAfterYes": 20, "beforeYesAfterNo": 3, "beforeNoAfterYes": 12, "beforeNoAfterNo": 25, "method": "exact", "alpha": 0.05, "decimalPlaces": 4 }

Key Facts

Category
Math, Date & Finance
Input Types
number, select
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The McNemar Test Calculator evaluates changes in paired binary data, such as before-and-after studies or matched-pair designs. By analyzing discordant pairs, it determines if a significant shift in proportions has occurred using either the Exact Binomial method or the continuity-corrected Chi-Square test.

When to Use

  • Analyzing the effectiveness of a treatment in a pre-test/post-test study with binary outcomes.
  • Comparing the performance of two different diagnostic tests applied to the same group of subjects.
  • Evaluating opinion shifts in a survey where the same individuals are polled at two different time points.

How It Works

  • Enter the frequencies for the four possible outcomes: Yes/Yes, Yes/No, No/Yes, and No/No.
  • Select the calculation method, choosing between Exact Binomial for small samples or Chi-Square for larger datasets.
  • Set your significance level (Alpha) and preferred decimal precision for the results.
  • Review the calculated p-value and discordant pair count to determine if the null hypothesis should be rejected.

Use Cases

Medical researchers comparing patient symptoms before and after a specific clinical intervention.
Marketing analysts measuring brand awareness among the same focus group before and after an advertising campaign.
Quality control engineers testing if a machine recalibration significantly changed the pass/fail rate of components.

Examples

1. Clinical Trial Symptom Analysis

Clinical Researcher
Background
A researcher is testing a new antihistamine on a group of patients to see if it reduces the presence of a specific allergy symptom.
Problem
Determine if the medication significantly changed the proportion of patients experiencing the symptom.
How to Use
Input 20 for 'Before Yes After Yes', 3 for 'Before Yes After No', 12 for 'Before No After Yes', and 25 for 'Before No After No'.
Example Config
Method: Exact Binomial, Alpha: 0.05, Decimal Places: 4
Outcome
The tool calculates a p-value of 0.0352, leading to a 'Reject Null' result, indicating a significant change.

2. Advertising Impact Study

Marketing Manager
Background
A brand surveyed 100 consumers about brand recognition before and after a major video campaign.
Problem
Verify if the increase in brand recognition among the same group of consumers is statistically significant.
How to Use
Enter the counts of consumers who recognized the brand in both phases, those who only recognized it after, and those who stopped recognizing it.
Example Config
Method: Chi-Square, Alpha: 0.01
Outcome
The calculator provides the Chi-Square statistic and p-value to confirm if the brand lift was a result of the campaign or random chance.

Try with Samples

math-&-numbers

FAQ

What are discordant pairs in a McNemar test?

Discordant pairs are the cases where the outcome changed between the two observations, specifically the 'Yes to No' and 'No to Yes' counts.

When should I use the Exact Binomial method?

Use the Exact Binomial method when the total number of discordant pairs is small, typically less than 25, to ensure statistical accuracy.

Does this tool handle independent samples?

No, the McNemar test is specifically designed for paired or matched data where the same subjects are measured twice.

What does 'Reject Null' mean in the results?

It indicates that the calculated p-value is less than your specified Alpha, suggesting the observed change is statistically significant.

Why are concordant pairs ignored in the calculation?

McNemar's test focuses exclusively on the direction of change; concordant pairs (Yes/Yes and No/No) do not provide information about the shift between states.

API Documentation

Request Endpoint

POST /en/api/tools/mcnemar-test-calculator

Request Parameters

Parameter Name Type Required Description
beforeYesAfterYes number No -
beforeYesAfterNo number No -
beforeNoAfterYes number No -
beforeNoAfterNo number No -
method select No -
alpha number No -
decimalPlaces number No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-mcnemar-test-calculator": {
      "name": "mcnemar-test-calculator",
      "description": "Test paired binary categorical changes with exact binomial or continuity-corrected chi-square McNemar test",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=mcnemar-test-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]