McNemar’s Test

The McNemar test is a statistical test used to analyze paired nominal (categorical) data. It is applied when we have two dependent (paired) samples and want to determine if there is a significant change or difference between the two related conditions.

When to Use the McNemar Test?

  • The data is categorical (e.g., Yes/No, Success/Failure, Present/Absent).
  • The samples are paired (i.e., the same subjects are measured twice).
  • The goal is to test if there is a significant change in proportions between two related conditions.

Applications

  • Medical studies: To check if a new treatment is more effective than the old one by comparing the same patients before and after treatment.
  • Marketing research: To assess if a customer changes their preference after a promotional campaign.
  • Psychology & behavioral studies: To evaluate whether an intervention changes behavior.

Contingency Table for McNemar Test

The test is based on a 2×2 contingency table:

Condition B: YesCondition B: NoRow Total
Condition A: Yesaba + b
Condition A: Nocdc + d
Column Totala + cb + dN
  • a = Number of cases where both conditions are “Yes.”
  • b = Number of cases where the first condition is “Yes” but the second is “No.”
  • c = Number of cases where the first condition is “No” but the second is “Yes.”
  • d = Number of cases where both conditions are “No.”

The McNemar test focuses on the discordant pairs (b and c).

Hypothesis of the McNemar Test

  • Null Hypothesis (H₀): The proportions of the two related groups are equal (no significant change).
  • Alternative Hypothesis (H₁): There is a significant difference between the two related proportions.

Test Statistics

\(\chi^2 = \frac{(b-c)^2}{b+c}\)

For small sample size use Edwards continuity correction

\(\chi^2 = \frac{(|b-c|-1)^2}{b+c}\)

The test statistic follows a Chi-square \(\chi^2\) distribution with 1 degree of freedom.

Decision Rule

  • Compare the computed \(\chi^2\) value with the critical value from the Chi-square table at α = 0.05.
  • Alternatively, calculate the p-value:
    • If p ≤ 0.05, reject H0H_0H0​ (significant difference).
    • If p > 0.05, fail to reject H0H_0H0​ (no significant difference).

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top