Ton J. Cleophas and Aeilko H. ZwindermanStatistical Analysis of Clinical Data on a Pocket CalculatorStatistics on a Pocket Calculator10.1007/978-94-007-1211-9_14© Springer Science+Business Media B.V. 2011

14. McNemar’s Tests

Ton J. Cleophas1, 2   and Aeilko H. Zwinderman2, 3  
(1)
Department of Medicine, Albert Schweitzer Hospital, Dordrecht, The Netherlands
(2)
European College of Pharmaceutical Medicine, Lyon, France
(3)
Department of Epidemiology and Biostatistics, Academic Medical Center, Amsterdam, The Netherlands
 
 
Ton J. Cleophas (Corresponding author)
 
Aeilko H. Zwinderman
Abstract
The past four Chapters have reviewed four methods for analyzing cross-tabs of two groups of patients. Sometimes a single group is assessed twice, and, then, we obtain a slightly different cross-tab. McNemar’s test must be applied by analyzing these kind of data.
The past four Chapters have reviewed four methods for analyzing cross-tabs of two groups of patients. Sometimes a single group is assessed twice, and, then, we obtain a slightly different cross-tab. McNemar’s test must be applied by analyzing these kind of data.

Example McNemar’s Test

315 subjects are tested for hypertension using both an automated device (test-1) and a sphygmomanometer (test-2).
   
Test 1
   
   
+
Total
Test 2
+
184
 54
238
 
 14
 63
 77
Total
198
117
315
 $$ \text{Chi - square McNemar}=\frac{{(54-14)}^{2}}{54+14}=23.5$$
184 subjects scored positive with both tests and 63 scored negative with both tests. These 247 subjects, therefore, give us no information about which of the tests is more likely to score positive.
The information we require is entirely contained in the 68 subjects for whom the tests did not agree (the discordant pairs). The above table also shows how the chi-square value is calculated. The chi-square table (page 32) is used for finding the appropriate p-value. Here we have again 1 degree of freedom. The 1 degree of freedom row of the chi-square table shows that our result of 23.5 is a lot larger than 10.827. When looking up at the upper row we will find a p-value  < 0.001. The two devices produce significantly different results at p  < 0.001.

McNemar Odds Ratios, Example

Just like with the usual cross-tabs (Chap. 14) odds ratios can be calculated with the single group cross-tabs. So far we assessed two groups, one treatment. two antihypertensive treatments are assessed in a single group of patients
Normotension with drug 1
   
Yes
No
Normotension
with drug 2
Yes
(a) 65
(b) 28
No
(c) 12
(d) 34
Here the OR  =  b/c, and the SE is not  $$ \sqrt{\left(\frac{1}{\text{a}}+\frac{1}{\text{b}}+\frac{1}{\text{c}}+\frac{1}{\text{d}}\right)},$$ but rather  $$ \sqrt{\left(\frac{1}{\text{b}}+\frac{1}{\text{c}}\right)}.$$
 $$ \rm{OR}=28/12$$
 $$ =2.33$$
 $${\rm lnOR}={\rm ln} {2.33}(\rm{ln}=\text{natural logarithm})$$
 $$ =0.847$$
Turn the ln numbers into real numbers by the anti-ln button (the invert button, on many calculators called the 2ndF button) of your pocket calculator.
 $$ \text{SE}=\sqrt{\left(\frac{1}{\text{b}}+\frac{1}{\text{c}}\right)}=0.345$$
A p-value can be calculated using the z-test (Chap. 10).
 $$ \rm{lnOR}\pm \rm{2 SE}=0.847\pm 0.690$$
The bottom row of the t-table (page 21) shows that this z-value is smaller than 2.326, and this means the corresponding p-value of  < 0.02. The two drugs, thus, produce significantly different results at p  < 0.02.