Definition

McNemar’s test is used to analyze paired nominal data (same samples are used for both conditions), particularly in before-and-after studies or matched-pair designs.

The test statistic is defined as

Examples

After treatment / No insomniaAfter treatment / Insomnia
Before treatment / No insomnia4515
Before treatment / Insomnia2515

Consider a null hypothesis The treatment is not effective. We can not reject the null hypothesis.