Class KruskalWallis

java.lang.Object
ubic.basecode.math.KruskalWallis

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

    • KruskalWallis

      public KruskalWallis()
  • Method Details

    • dof

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

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

      public static double test(DoubleArrayList scores, 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.