Example Using McNemar's Test To study the association between retirement and heart disease, 127 victims of cardiac arrest were matched with 127 healthy individuals; retirement status was then determined for each subject. Note that we have 254 (2 * 127) subjects in the study. Cardiac Arrest Yes | No Retired --------------------------- Yes 47 39 No 80 88 Note that each column adds up to 127, since there are 127 cardiac arrest victims and 127 who are not. Is there an association between retirement status and cardiac arrest? Suppose the raw data is available to us, so we can classify it in the following manner: Cardiac Arrest --------------- Retired | Not Retired No Cardiac Arrest ------------------------------------------------ Retired 27 12 Not Retired 20 68 This tells us that, of the 47 subjects who were retired and suffered cardiac arrest, 27 were matched with retired people who didn't suffer cardiac arrest and 20 were matched with people who were not retired and didn't suffer cardiac arrest. Each entry in this table corresponds to a combination of response from each pair, so the total of the numbers in this table is 127. NOTE: Given the information in the second table, we can construct the first table (the row and column values in the second table become the cell entries in the first table, etc). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > cardiac arr.ret arr.noret # arr.ret = Cardiac Arrest noarr.ret 27 12 # and Retired noarr.noret 20 68 > mcnemar.test(cardiac) McNemar's chi-square test with continuity correction data: cardiac McNemar's chi-square = 1.5312, df = 1, p-value = 0.2159