Analyses · Categorical · Standard

Running a McNemar test in Quanta

The same people classified twice, and the question of whether the classification changed. Why only the cases that switched matter, and how to report it in APA 7.

What the test answers

McNemar's test compares a binary outcome measured twice on the same people. Passed or failed, before and after a course. Correct or incorrect, on two occasions. Approve or disapprove, before and after a campaign.

It is the categorical counterpart to the paired t test, and it exists because chi-square cannot be used here. Chi-square assumes every observation is independent, and a person counted at both time points is not independent of themselves.

The mechanism is worth understanding because it explains the sample size. Consider the four possible histories: failed both times, passed both times, failed then passed, passed then failed. The two consistent groups carry no information about change, because they did not change. Only the discordant pairs count, the people who switched in one direction versus the other. If those two numbers are roughly equal, nothing systematic happened. If they are lopsided, something did.

This is why a study of 200 people can rest on 30 informative cases, and why the number of discordant pairs belongs in the report.

When it fits

A binary outcome measured twice on the same people, or on matched pairs such as a case matched to a control.

The pairing must be real and consistently ordered. Each row is one person or one matched pair.

Watch the discordant count. With few discordant pairs, roughly under 25, the standard chi-square approximation becomes unreliable and an exact version is the appropriate report. The relevant sample size is the number who changed, not the number enrolled.

For an outcome with more than two categories measured twice, McNemar does not apply and its generalization, the Stuart-Maxwell test, is required. For a numeric outcome measured twice, use the paired-samples t test.

Running it in Quanta

Lay the data out in wide format. One row per person, with the two classifications in two separate columns, for example Pre_Status and Post_Status. This is the opposite of the layout a two-group chi-square wants.

Upload the categories as text rather than numeric codes so both variables are typed as categories.

Configure the two columns in the Setup panel on the right and the result appears in the center panel.

Read the 2×2 table before the p value and find the two discordant cells. Those two numbers are the study.

Reporting it in APA 7

Report the test statistic with its degrees of freedom, p, the total sample, and the discordant counts.

A McNemar test showed a significant change in classification following the intervention, χ²(1, N = 120) = 9.31, p = .002. Of the 34 participants who changed, 27 moved from failing to passing and 7 moved in the opposite direction.

Give both discordant counts. They are the finding, and a reader who sees only the p value cannot tell how much of the sample carried it.

Say whether the exact version was used, and use it when the discordant total is small.

A change over time is not evidence that your intervention caused it. Without a control condition, the honest claim is that the classification changed, not that you changed it.

Explaining the result, on your Mac

Every result carries a ReliCheck Intelligence card with one action: explain this result in plain language. It runs entirely on your Mac with Apple Intelligence. No upload, no API key, nothing to configure. The model only explains the result Quanta has already computed and validated. It never computes a statistic, and it never applies a decision on your behalf.

From the action bar you can add the result to a report, copy the table, or copy the APA text. Exported reports carry the APA table, its note, and a caution specific to that analysis beneath it.

Validation

Pure Swift, validated

Quanta's engine is pure Swift on Apple's Accelerate framework, with no R or Python at runtime. Every engine is checked against an independent reference rather than internal consistency alone, and the automated suite exceeds 500 checks. Full record on the validation page.

Included in

Standard

Categorical is part of every Quanta subscription, $9.99 a month or $79.99 a year after the 30-day trial. One price for everyone. See pricing.

On your Mac

Runs offline

The analysis, the report builder, and the on-device explanations all work with the network off. Your dataset is never uploaded.

Related analyses

Chi-square test of independence for two separate groups · Fisher exact test for small unpaired 2x2 tables · Paired-samples t test for a numeric outcome measured twice · the complete list on the analyses page.