Running a Cochran's Q test with XLSTAT

Dataset to run a Cochran Q test and goal of this tutorial

An Excel sheet with both the data and the results can be downloaded by clicking here.

This tutorial explains how to run a Cochran’s Q test. The data correspond to a survey where several teenagers have been asked to tell if they like packaging of a computer game (answer is Yes in the dataset) or not (answer is No in the dataset). We want to know if there is a significant difference between the packaging options or not, and to decide if one packaging appears to be superior to the other or not before the product goes to production.

As for any test, we need to know what the null and alternative hypotheses are. In our case, the null hypothesis is that there is no difference between the packaging. The alternative hypothesis, that the decision makers would like to be confirmed, is that there is a difference.

Setting up a Cochran's Q test

After opening XLSTAT, select the XLSTAT / Nonparametric tests / Cochran’s Q test, or click on the corresponding button of the Nonparametric tests toolbar.

menu cochran

Once you've clicked the button, the dialog box appears. Select the data on the Excel sheet. The Data are in the B to E columns.

 dialog box cochran

We activate the Multiple pairwise comparisons option in order to identify which packaging (one or more) are responsible for rejecting the null hypothesis in case we reject it.

The computations begin once you have clicked the OK button.

Interpreting the results of a Cochran's Q test

Then, the results of the Cochran’s Q test and their interpretation are displayed.

results cochran Q

We see that the null hypothesis is rejected if we use a significance level of 0.05. As a reminder, choosing a significance level of 0.05 is the same as deciding that we want to be right in 95% of cases (and wrong in 5% of cases) when rejecting H0.

For the decision makers, that means that choosing a packaging at random or using a manager’s preference would not make sense as long as the sample of teenagers has been well chosen. We now want to identify if one or more packaging are responsible for rejecting H0. The following results give us the answer:

 results cochran Q pairwise

We see that the packaging 3 and 1 are different, while the other packaging are not statistically different. However as the packaging that received the more “Yes” is Pack3, it seems to be the best choice.

Click here for other tutorials.

About KCS

Kovach Computing Services (KCS) was founded in 1993 by Dr. Warren Kovach. The company specializes in the development and marketing of inexpensive and easy-to-use statistical software for scientists, as well as in data analysis consulting.

Mailing list Join our mailing list

Home | Order | MVSP | Oriana | XLStat
QDA Miner | Accent Composer | Stats Books
Stats Links | Anglesey


Like us on Facebook Facebook

Get in Touch

  • Email:
  • Address:
    85 Nant y Felin
    Pentraeth, Isle of Anglesey
    LL75 8UY
    United Kingdom
  • Phone:
    (UK): 01248-450414
    (Intl.): +44-1248-450414