1. Home
  2. Cochran’s Q Test

Cochran’s Q Test

Select menu: Stats | Statistical Tests | Cochran’s Q Test

Cochran’s Q test is an extension to the McNemar test for related samples. It provides a method for testing for differences between three or more matched sets of frequencies or proportions. The matching samples can be based on K characteristics of N individuals that are associated with the response. Alternatively, N individuals may be observed under K different treatments or conditions (e.g. different questions or one question at different times).

  1. After you have imported your data, from the menu select 
    Stats | Statistical Tests | Cochran’s Q Test.
  2. Fill in the fields as required then click Run.

You can set additional options by clicking Options or Store.

The data must be supplied as dichotomous variables containing 0 to represent failure (or absence), and 1 to represent success (or presence). The variables can be stored in separate variates; alternatively, all the data can be stored in a single variate with a factor to indicate which variable is recorded in each unit of the variate. Note that it is assumed the individuals are recorded in the same order for each variable.

In its original form, Cochran’s Q test leads to a chi-square test. However, this may be inaccurate when there are small numbers of subjects or samples. For this situation you can use Exact probability (based on the exact distribution of Q under a permutation model). For further details of the methods see QCOCHRAN.

Data arrangement

The data can be supplied either as a list of variates or as a single variate with a factor defining the groups.

List of variates For multiple data this lets you specify two or more variates containing dichotomous data for the different variables. You can transfer multiple selections from Available data by holding the Ctrl key on your keyboard while selecting items, then click to move them all across in one action.
One variate with group factor The data must be supplied in one variate. Membership of the different samples is then indicated by the Group factor.

Available data

A list of variates and factors that can be used to supply the data sets and groups. The contents may change as you move from one input field to another, so that appropriate types of data structure are listed. Double-click on a name to copy it into the input field, or type the name in directly.


Specifies the form of the test. You can set this to either Chi-square or Exact. Alternatively, you can select Automatic to let Genstat automatically use an appropriate test. When this is selected Genstat will run an exact test if the number of values in the samples is fewer than 4 and the product of this value with the number of samples is fewer than 24, otherwise the Chi-square method will be used.

Action Icons

Pin Controls whether to keep the dialog open when you click Run. When the pin is down  the dialog will remain open, otherwise when the pin is up  the dialog will close.
Restore Restore names into edit fields and default settings.
Clear Clear all fields and list boxes.
Help Open the Help topic for this dialog.

See also

Updated on June 13, 2019

Was this article helpful?