How to Run the McNemar Test in SPSS: A Step-by-Step Guide for Non-Statisticians

This guide explains how to perform the McNemar test in SPSS using clear, beginner-friendly steps. It also includes a real-world example to help non-statisticians understand when and how to apply the test accurately.
Imagine a school rolls out a new tutoring program, hoping it will help struggling students pass their math tests. The same students are tested before and after the program. Some improve; some don’t. The question is simple: Did the program actually make a difference?
This is where the McNemar test comes in. If you’ve ever felt intimidated by statistics, don’t worry, this article is for you. Whether you’re a student, a teacher, a healthcare worker, or a researcher without a stats background, we will walk you through the McNemar test in SPSS step by step.
If you ever find yourself struggling to interpret SPSS outputs or write the results section for your dissertation, Cheap Essay Writing UK offers expert academic assistance. Their writers simplify statistical interpretation and help you present your findings accurately and clearly.
Here’s what you’ll learn: what the McNemar test is, when to use it, and how to set up your data correctly. Along the way, we will use a real-life example of a tutoring program so everything feels concrete and practical.
Introduction to the McNemar Test
At its core, the McNemar test is a way of checking whether there has been a significant change in outcomes. Especially when the same group of people is measured at two different points in time. Think of it as asking: Are the “before” and “after” results different enough that we can rule out chance?
Here are the key ideas in plain language:
- Paired groups: The same individuals are measured twice. For example, the same students take both a pre-test and a post-test.
- Two possible outcomes: The outcome must be dichotomous (a fancy word for “two categories”). Examples include pass/fail, yes/no, improved/did not improve, smoker/non-smoker.
- Purpose: The test checks whether the proportion of people who changed from one category to the other is significant.
When Should You Use It? Use the McNemar Test When:
- You have paired or repeated measures (before/after, matched pairs, repeated responses).
- Your outcome has only two categories.
- You want to see if there’s been a change in proportions, not just a raw difference in numbers.
What it’s not: Don’t confuse it with the regular Chi-Square test of independence, which is for comparing two different groups. If you’re measuring the same people twice, the Chi-Square test will give the wrong answer. Because it ignores the fact that the data are paired.
That’s where the McNemar test shines; it’s specifically designed for these “before and after” scenarios. Following is an example of a data set:
Key Concepts and Assumptions for Non-Statisticians
To run the McNemar test with confidence, let’s unpack a few key concepts in everyday terms.
Dichotomous Variable. A dichotomous variable is just a variable with two possible outcomes. Think of it like a coin flip: heads or tails. In research, that could be:
- Did the patient improve? Yes/No.
- Did the student pass the test? Pass/Fail.
- Did the smoker quit? Quit/Did Not Quit.
In our tutoring example, the outcome is simple: Pass or Fail on the math test.
Paired Data
This is where things often get confusing. “Paired data” means that we measure the same person twice or link two people who are directly connected. Imagine you’re your own “before” and “after” picture. The key is that the data points are not independent—each student’s post-test score is tied to their pre-test score.
This is different from comparing two independent groups (like comparing Class A vs. Class B). With the McNemar test, every student is their own control.
Hypotheses
All statistical tests start with hypotheses:
- Null hypothesis (H₀): There is no change. The proportion of students who pass after the program is not significantly different from before.
- Alternative hypothesis (Hₐ): There is a change. The tutoring program shifts the proportion of students passing.
Assumptions of the McNemar Test
To use the McNemar test properly, a few conditions should be met:
- Paired data – You must have repeated measures or matched pairs.
- Dichotomous outcome – The variable must have exactly two categories.
- Sufficient sample size – The test works best when you have at least 10–20 discordant pairs (we’ll explain these shortly). This is because the test’s math relies on having enough “mismatches” to work with.
If you don’t have enough discordant pairs, don’t panic; there are alternative tests like the binomial test, but the McNemar test may not be reliable.
A Real-Life Example: A Case Study on Learning Intervention
A school is testing whether a new tutoring program improves math performance. They select 50 students who previously struggled. Each student takes a pre-test before starting tutoring and a post-test after completing the program.
The Data
The outcome is simple: Pass or Fail. This gives us four possibilities when we compare the before and after results:
- Passed both times – The student was already doing fine.
- Failed both times – The program didn’t help.
- Failed pre, passed post – The program seems to have worked.
- Passed pre, failed post – Odd, but it happens (maybe the student had a bad test day).
Here’s what the data might look like in a 2x2 contingency table:
| Post-Test: Pass | Post-Test: Fail | |
|---|---|---|
| Pre-Test: Pass | 15 | 5 |
| Pre-Test: Fail | 20 | 10 |
Let’s interpret this:
- 15 students passed both tests.
- 10 students failed both.
- 20 students improved (failed pre, passed post).
- 5 students declined (passed pre, failed post).
The discordant pairs are the ones who changed categories (20 improved, 5 declined). These are the numbers that fuel the McNemar test.
Why McNemar?
This is the perfect scenario for the McNemar test because:
- It involves the same students measured twice (paired data).
- The outcome has only two categories (pass/fail).
- The goal is to check if the tutoring program led to a change in the proportions of students passing.
Without the McNemar test, we might be tempted to just look at the raw numbers, but we need a formal test to know whether the observed difference is statistically meaningful or just random chance.
Running the McNemar Test in SPSS: The Step-by-Step Walkthrough
Now that we understand the context, let’s roll up our sleeves and actually run the test in SPSS.
Preparing Your Data
This is where many beginners stumble. In SPSS, you need two separate columns: one for pre-test results and one for post-test results. Each row represents a student. For example:
| Student | Pre_Test | Post_Test |
|---|---|---|
| 1 | Fail | Pass |
| 2 | Pass | Pass |
| 3 | Fail | Fail |
| … | … | … |
Both columns should be coded with just two categories, e.g., 0 = Fail, 1 = Pass.
Running the Test
Follow these steps in SPSS:
- Go to Analyse → Nonparametric Tests → Legacy Dialogues → 2 Related Samples.
- In the new window, move your two variables (Pre_Test and Post_Test) into the Test Pairs box.
- Check the box for McNemar. Uncheck others (like Wilcoxon) unless you want them.
- Click OK.
Interpreting the Output
SPSS will give you two main things:
- Crosstabulation Table – This is your 2x2 table again. Focus on the discordant pairs (students who changed categories). These numbers are the backbone of the test.
- Test Statistics Table – This shows:
- McNemar’s Chi-Square – the test statistic.
- Asymp. Sig. (2-tailed) – the p-value.
Decision Rule
This is the part everyone cares about. Here’s the simple rule of thumb:
- If p < 0.05 → Reject the null hypothesis. Conclude that there is a significant change.
- If p ≥ 0.05 → Fail to reject the null. Conclude that there isn’t enough evidence for a change.
Connect with an experienced dissertation writer at Cheap Essay Writing UK who can help you interpret data, draft accurate results, and link findings to your research objectives.
What Your Results Mean: A Non-Technical Interpretation
The following table shows an example of results for the McNemar test in SPSS that can be interpreted:
Let’s tie it back to our tutoring example.
Example 1: Significant Result
Suppose SPSS gives a p-value of 0.02. That’s less than 0.05, so we reject the null hypothesis.
In Plain English: “The tutoring program had a statistically significant effect on students’ pass rates. More students passed the math test after the program than before.”
Example 2: Non-Significant Result
Now, suppose the p-value is 0.25. That’s greater than 0.05, so we fail to reject the null hypothesis.
Plain English: “We cannot conclude that the tutoring program made a significant difference in students’ pass rates. Any changes we see might just be due to chance.”
Effect Size
Statistical significance is important, but it’s not the whole story. With a large enough sample, even tiny differences can be significant. That’s why researchers also look at effect size, which tells us how big the change really is.
For McNemar’s test, a common effect size measure is the phi coefficient (φ). Think of it as a measure of the strength of the change:
- φ close to 0 = tiny effect.
- φ closer to 1 = strong effect.
So, reporting both the p-value and the effect size gives a fuller picture: “Yes, the program made a difference, and the effect was moderately strong.
Troubleshooting and Common Pitfalls
Even with clear instructions, mistakes happen. Here are the common pitfalls:
- Using the wrong test: Don’t use a regular Chi-Square test for this kind of paired data—it assumes the groups are independent, which isn’t true here.
- Data setup errors: Many beginners try to put all their scores in one column with labels like “pre” or “post.” That won’t work. You need two separate columns (one for each time point).
- Small sample size: If you have very few discordant pairs (fewer than 10–20), the McNemar test may not be reliable. In such cases, consider the exact binomial test, which SPSS also offers under the same dialogue.
Being aware of these issues upfront can save you a lot of confusion later.
Conclusion and Next Steps
The McNemar test is a powerful yet simple tool for answering before-and-after questions with paired, two-category data. In our tutoring example, it helped us determine whether the program truly boosted student performance.
To recap: you learned what the McNemar test is, when to use it, how to run it in SPSS, and how to interpret the results in plain English.
Get expert guidance from a professional team through dissertation writing services at Cheap Essay Writing UK. Whether it’s analysing results, writing the methodology, or polishing your discussion chapter, our academic experts make data interpretation easy and accurate.
FAQs
What is the McNemar test used for?
The McNemar test evaluates whether there is a significant change in paired categorical data with two outcomes. It’s especially useful in before-and-after studies, where the same participants are measured twice, helping researchers determine if an intervention or treatment meaningfully shifts outcomes.
How do I calculate the McNemar test manually?
To calculate manually, focus only on the discordant pairs—the participants who switched categories. Square the difference between them, divide by their sum, and compare this statistic to a chi-square distribution with 1 degree of freedom. This checks whether the observed change is significant.
When should you use the McNemar test instead of the chi-square?
Use McNemar when the same individuals are measured twice, like pre- and post-tests. The chi-square test of independence assumes two unrelated groups, which ignores the paired nature of repeated measures. McNemar correctly accounts for within-person changes and avoids misleading results.
How to run the McNemar test in SPSS?
In SPSS, set up two columns (before and after results). Then go to Analyse → Nonparametric Tests → Legacy Dialogues → 2 Related Samples. Select your paired variables, check “McNemar,” and click OK. SPSS outputs the contingency table and test statistics.
Can the McNemar test be applied in medical studies?
Yes, it’s widely used in medical research. For example, a study might record whether patients test positive or negative for a condition before and after treatment. McNemar helps determine if the treatment significantly altered outcomes, accounting for the same patients being measured twice.
What does a significant McNemar test mean?
A significant McNemar result means the observed change in paired outcomes is unlikely due to chance. In practice, it indicates that the intervention, treatment, or event likely caused a real shift in proportions, such as more patients improving or more students passing.
How is the McNemar test different from Fisher’s exact test?
Fisher’s exact test is for small-sample, independent group comparisons in a 2x2 table. McNemar, however, is for paired data, where the same participants are measured twice. They answer different questions: Fisher’s examines the association between groups, and McNemar examines the change within individuals.
What are the assumptions of the McNemar test?
The McNemar test assumes three things: data come from paired measurements, the outcome variable has exactly two categories, and there are enough discordant pairs to support the chi-square approximation. If discordant counts are too low, an exact binomial version is recommended instead.
How to interpret McNemar test results in R?
In R, run “mcnemar.test()” on your paired table. If the p-value is below 0.05, reject the null hypothesis and conclude there’s a significant change. If it’s higher, conclude there’s insufficient evidence for change. Always report both significance and practical effect size.
Is the McNemar test suitable for small sample sizes?
Not always. When there are very few discordant pairs (fewer than 10–20), the chi-square approximation may be unreliable. In such cases, use the exact binomial test instead, which provides more accurate results for small samples while still addressing paired data.
Cite this article
If you want to cite this source, you can copy and paste the citation or click the Cite this article button to automatically add the citation to our free Citation Generator.
Jonat N. (October 8, 2025).
How to Run the McNemar Test in SPSS: A Step-by-Step Guide for Non-Statisticians to Improve Grades and Save Time Retrieved August 26, 2026, from
https://www.cheap-essay-writing.co.uk/blog/2025/10/mcnemar-test-in-spss
