Summary
Highlights
McNemar's test is a Z-test for two dependent proportions, used when comparing two paired groups on a binary variable. It's applicable for repeated measures on the same subjects or for matched pairs based on similar background variables.
Research questions suitable for McNemar's test include observing changes in smoking habits after an anti-smoking campaign, where the same individuals are measured twice. Another example involves comparing two different diets in matched pairs of cats, where pairs are created based on age, sex, and other characteristics.
To analyze outcomes, all possible combinations per pair are considered. In the cat diet example, these include both healthy, one healthy and one with problems, or both with problems. The test focuses on 'inconsistent' combinations (where only one in the pair shows the outcome of interest) as these indicate a difference between the paired conditions.
The combinations are organized into a two-by-two table. Diagonal cells represent consistent outcomes (both healthy or both with problems), which are less relevant. The off-diagonals represent the inconsistent outcomes, crucial for determining the effect of the intervention or difference between conditions.
For one-sided tests, a sufficient number of observations (sum of inconsistent cases at least 30) is needed. Two-sided tests work well even with small samples. The null hypothesis states that the population proportion is the same between the two groups. Alternative hypotheses suggest unequal proportions.
The Z-test statistic is calculated as the difference between the two off-diagonal elements (inconsistent cases) divided by the square root of their sum. This statistic follows a standard normal distribution.
Using the cat example, with enough inconsistent pairs (sum of 51), a one-sided alternative hypothesis predicts raw-fed cats will have fewer urinary problems. A calculated Z-value of 2.38 results in a p-value of 0.01, which is less than the significance level of 0.05. Therefore, the null hypothesis is rejected, supporting that raw-fed cats have a lower proportion of urinary problems.
Using matched pairs or repeated measures on the same subjects eliminates random error caused by individual differences and irrelevant background variables. This leads to smaller standard errors and a higher probability of rejecting the null hypothesis when a real effect exists, making the test more powerful.