Friday, December 02, 2005

McNemar's Test

McNemar's test is is a non-parametric method used on nominal data to determine whether the row and column marginal frequencies are equal. It is named after McNemar, Q., who introduced it in 1947. Given 2 x 2 contingency table with a dichotomic trait with matched pairs of subjects.
In the following example, a researcher attempts to determine if a disease is associated with the presence of a particular gene. Individuals without the disease are controls and individuals with the disease are cases. Within the cases and controls, individuals with the hypothesized disease gene are marked as positive for the presence of the gene and individuals without the gene are marked as negative.


The cells can be represented in the following manner by the letters a, b, c and d, The totals across rows and columns marginal totals, and the grand total is represented by n:


Marginal homogeneity occurs when the row totals are equal to the column totals, a and d in each equation can be cancelled; leaving b equal to c:

(a + b) = (a + c)
(c + d) = (b + d)

The McNemar statistic is shown below:

χ2 = (bc)2 / (b + c)

χ2 is a chi-squared statistic with the df = 1. The formula may be re-written to correct for discontinuity:

χ2 = ( | bc | − 1)2 / (b + c)

The marginal frequencies are not homogenous, if the the χ2 result is significant p < 0.05. If b and/or c are small, (b + c) < 10, χ2 is not approximated by the chi-square distribution instead a Fisher's exact test should be used.

No comments: