Worked example · McNemar's test

McNemar's test or chi-square? Paired yes/no data, decided.

The reproducible worked example behind our McNemar lesson: 200 paired approve/deny decisions, agreement, kappa, and the four variants of the test.

The data

200 paired approve/deny decisions from two reviewers on the same cases, generated at seed 42 so it reproduces exactly.

The headline numbers

85% agreement sounds like reassurance. It is not. The 30 disagreements split 24 to 6, which is one reviewer holding a lower bar rather than two people being human.

Download and re-run it

Every figure in the document is derived when it is knitted, not typed in. Re-run the source and you should get the same numbers, or we have a problem worth hearing about.

The honest limit

The test tells you the two judges differ. It cannot tell you which one is correct. The remedy is calibration, not blame.

Where this came from