The McNemar test for two related groups can be extended to more than two groups. This extension is called the Cochran Q test. It is a method for testing whether three or more matched sets of frequencies differ significantly. The matching can be on relevant features of different people, or the same person can be used under different conditions.
Scores for the Cochran Q test can take only two values: zero or one. The value one represents values that are recorded as positive, while the zero represents those that are negative. The requirements for the Cochran Q test are as follows :
Nominal data
Three or more groups
Related groups
Data in frequency form
Two-tail test only
The Cochran Q formula is:
where k = number of groups, R = row totals, C = column totals, and T = grand total (sum of R or sum of C).