McNemar's test EN - pdmoerland/wiki-biostatistiek-bilingual GitHub Wiki
Deze pagina lezen in het Nederlands.
Author: dr. ir. N. van Geloven
AuthorshipThis page was translated from the Dutch-language original using AI and has not been fully reviewed. Where the two differ, the Dutch version takes precedence.
- When do I use McNemar's test?
- Can I use McNemar's test to compare the sensitivity and specificity of two tests performed on the same patients?
- Can I still use McNemar's test if there is a 0 in my 2x2 table?
- Where do I find McNemar's test in SPSS?
- References
McNemar's test is a test for comparing paired proportions. For example, when comparing a before and an after measurement. The test is also known as McNemar's test of symmetry or the McNemar symmetry chi-square test, because it examines whether the cells of the 2x2 table are symmetrically distributed.
If the two measurements are not paired (but determined in different groups of patients), the Chi-square test or Fisher's exact test is used to compare proportions.
If you want to test whether the values of two paired proportions, each measured twice, differ from each other, you can use McNemar's test. For example, if you want to test whether two diagnostic methods give a certain diagnosis equally often.
Suppose we compare whether the diagnosis of "ligament injury" after a bruised ankle based on physical examination gives the same result as when the presence of a ligament injury is determined using ultrasound. For 200 bruised ankles, the diagnosis of ligament injury present or absent was determined based on physical examination and, independently, based on ultrasound. This yields the following table:
| Physical examination | |||
| ligament injury present | no ligament injury | ||
| Ultrasound | ligament injury present | 150 | 11 |
| no ligament injury | 9 | 30 | |
In this case, the proportions 161/200 and 159/200 are very similar, and McNemar's test concludes that both methods indicate ligament injury equally often (p=0.64).
Can I use McNemar's test to compare the sensitivity and specificity of two tests performed on the same patients?
I have a question about comparing the sensitivity and specificity of different diagnostic modalities. The researcher in question determined the sensitivity and specificity of 2 different modalities in the same patients. Is it possible to compare these statistically in order to conclude that one modality is better than the other? If so, can this be done with simple McNemar tests, or do we need to do something else?
Yes, if you select everyone who is positive according to the gold standard, you can perform a McNemar test to see whether one of the two modalities gives more 'true positives'. Likewise, you can select everyone who is negative according to the gold standard and then use a McNemar test to see whether one of the two modalities gives more 'true negatives'.
I would like to ask a question about comparing two measurements in paired data (this concerns very small patient numbers, which unfortunately cannot be improved given the rarity of the disease). In the first measurement, 5 of 12 patients reach the normal values; in the second measurement, 0/12 do. Can I do any statistics on this at all, e.g. a McNemar test? Or are the numbers simply too small? A 2x2 table looks like this:
| Measurement 2 | |||
| yes | no | ||
| Measurement 1 | yes | 0 | 5 |
| no | 0 | 7 | |
To perform a statistically valid test on this, you could use the exact version of McNemar's test. See also this website on the possibilities for this, implemented in R package exact2x2.
You will find McNemar's test in SPSS 16 under Analyze -> Nonparametric Tests -> Legacy Dialogs -> 2 Related Samples. Check McNemar under Test Type (Wilcoxon can be unchecked).
Finished reading? You can go to the Overview of all topics, or to Choosing a test for help picking a suitable test or analysis. Want to learn more about biostatistics? Then follow the AMC e-learning Practical Biostatistics. Did you find something on these pages that isn't correct? Does a link not work? Or would you like to contribute to the wiki? Then get in touch with us.
This biostatistics wiki is an initiative of the former statistics helpdesk of Amsterdam UMC, location AMC. Amsterdam UMC staff can request statistical support via intranet.