Class KruskalWallis


  • public class KruskalWallis
    extends Object
    Perform a Kruskal-Wallis test.
    Author:
    paul
    • Constructor Detail

      • KruskalWallis

        public KruskalWallis()
    • Method Detail

      • dof

        public static int dof​(cern.colt.list.DoubleArrayList scores,
                              cern.colt.list.IntArrayList groupings)
        Parameters:
        scores -
        groupings -
        Returns:
        number of degrees of freedom (number of groups - 1)
      • kwStatistic

        public static double kwStatistic​(cern.colt.list.DoubleArrayList scores,
                                         cern.colt.list.IntArrayList groupings)
        Parameters:
        scores -
        groupings -
        Returns:
        statistic; chi-squared with numgroups - 1 dof under the null.
      • test

        public static double test​(cern.colt.list.DoubleArrayList scores,
                                  cern.colt.list.IntArrayList groupings)
        Perform a Kruskal-Wallis one-way ANOVA.

        Implementation note: Does not make special corrections for ties, though ties are given the averaged ranks. Completely bare-bones. Missing values are not tolerated well.

        Parameters:
        scores -
        groupings - integer indicators of which values are in which groups. The actual values don't matter.
        Returns:
        p-values based on the chi-squared statistic.