Algorithm 983

Algorithm 983: Fast Computation of the Non-Asymptotic Cochran’s Q Statistic for Heterogeneity Detection. The detection of heterogeneity among objects (products, treatments, medical studies) assessed on a series of blocks (consumers, patients, methods, pathologists) is critical in numerous areas such as clinical research, cosmetic studies, or survey analysis. The Cochran’s Q test is the most widely used test for identifying heterogeneity on binary data (success vs. failure, cure vs. not cure, 1 vs. 0, etc.). For a large number of blocks, the Q distribution can be approximated by a χ2 distribution. Unfortunately, this does not hold for limited sample sizes or sparse tables. In such situations, one has to either run Monte Carlo simulations or compute the exact Q distribution to obtain an accurate and reliable result. However, the latter method is often disregarded in favor of the former due to computational expense considerations. The purpose of this article is to propose an extremely fast implementation of the exact Cochran’s Q test so one can benefit from its accuracy at virtually no cost regarding computation time. It is implemented as a part of the XLSTAT statistical software (Addinsoft 2015). After a short presentation of the Cochran’s Q test and the motivation for its exact version, we detail our approach and present its actual implementation. We then demonstrate the gain of this algorithm with performance evaluations and measurements. Comparisons against a well-established implementation have shown an increase of the computational velocity by a factor ranging from 100 up to 1× 106 in the most favorable cases.

Keywords for this software

Anything in here will be replaced on browsers that support the canvas element