The procedure below draws on NAG algorithms.
The scores in each column are ranked, denoting the rank within block of the observation in treatment. Average ranks are assigned to tie scores.
The significance level is compared to the distribution with degrees of freedom, where k is the total number of samples
For more details of the algorithm, please refer to nag_friedman_test (g08aec)