During the last ten years, many algorithms for calculating exact distributions of discrete random variables have been developed, particularly for the independent 2-sample case. Exact distributions for quadratic statistics such as the Friedman test or the Kruscal Wallis test are still lacking. The Friedman test is part of most of the major statistical packages, though usually not very well documented, and of course only applicable in its approximate form. I develop an algorithm for calculating the exact distribution of the Friedman test which is feasible with respect to time and memory contraints on commonly available PC's.
For establishing this algorithms, some properties of the symmetric group G
The Friedman statistic is a quadratic statistic. It is useful in situations where one has no idea about the direction of the deviations between the treatments under the alternative hypothesis. In the proposed development we will make use of particular properties of the usual Friedman statistic only in the final part. In fact, for the derivation of distributions of other often used tests one can apply similar ideas. Examples are provided by all linear functions (i.e. contrasts between the treatments). Among others, the exact distribution of the Page test falls into this class, which is of use, when dose response is investigated, i.e. when the treatments t1, t2, ..., tk represent increasing doses of the same substance. More examples can be constructed, when a particular (partial) order is specified under the alternative hypthesis. The computation of exact distributions of linear statistics is straight forward and can be achieved by convolution. Only quadratic statistics need special attention.
The complexity of the algorithms will be discussed, and APL programms will be provided. Some further simplifications of the algorithms by means of combinatorial properties will be proposed.