|
|
The McNemar test assesses the significance of the difference between two dependent samples when the variable of interest is a dichotomy. It is used primarily in before-after studies to test for an experimental effect. Also for two dependent samples, the marginal homogeneity test is an extension of the McNemar test for multinomial variables (more than two categorical values). The sign test and the more powerful Wilcoxon signed-ranks test are for two dependent samples when the variable of interest is continuous.
| Exposed | Not Exposed | ||
| Time 2 | Exposed | a | b |
| Time 2 | Not Exposed | c | d |
Note that you cannot have a simple table where the columns are "Time 1" and "Time 2", and the rows are "Exposed" and "Not Exposed", because then observations would appear twice in the table!
The McNemar test uses the chi-square distribution, based on this formula:
| a | b | r1 |
| c | d | r2 |
| c1 | c2 | n |
Example:
| 6 | 20 | |
| 10 | 14 | 24 |
| 16 | 34 | 50 |