Categorical
McNemar’s test
Compares two binary measurements taken on the same subjects.
Variables
- First measurementNominal · Ordinal — 1
- Second measurementNominal · Ordinal — 1
Options
- MethodExact conditional test · Asymptotic (χ²) · Asymptotic, with continuity correction
- Event levelSecond level · First level
What it reports
Tests marginal homogeneity for paired binary measurements: the exact conditional test, two asymptotic forms, the matched-pairs odds ratio and its exact interval.
scipy · statsmodels · Open the accuracy report
When does this apply?
For a binary measurement recorded twice on the same units: before and after an intervention, or two methods applied to one object. Every observation must carry both measurements, and both columns must hold exactly the same two levels. The test rests only on the pairs that changed: unchanged pairs do not enter it.