The procedure is used to compare three or more groups on a dependent variable that is measured on at least an ordinal level.
All the data are pooled and ranked from smallest (1) to largest (N), then the sums of ranks in each subgroup are added up, and the probability is calculated. The statistic H is
where N is the total number, ni is the number in the i-th group, and Ri is the total sum of ranks in the i-th group; in the second equation . Either equation can be used. The value of H is tested against the chi-square distribution for k − 1 degrees of freedom, where k is the number of groups. If there are tied ranks a correction is used but makes very little difference.
(Analysis of Variance. I. One-Way Julien I.E. Hoffman, in Basic Biostatistics for Medical and Biomedical Practitioners (Second Edition), 2019)