Class LeveneStat


public class LeveneStat extends FStat
Class representing an F-test statistic for Levene's test.

This class defines a statistic W that allows one to determine if multiple subgroups (a total of k subgroups) of a sample of size N have the same variances. The number of data points in the ith subgroup is denoted as Ni and the jth entry in the ith is denoted as Yij.

The statistic W is defined as $$W = \frac{N-k}{k-1} \frac{\sum_{i=0}^{k-1}N_i(\mbox{z̅}_{i.}n - \mbox{z̅}_{..})^2}{\sum_{i=0}^{k-1}\sum_{j=0}^{N_i-1} (z_{ij} - \mbox{z̅}_{i.})^2}$$ where Ni is the sample size of the ith subgroup, zij = |Yij - Mi|, and where Mi is defined as either

  1. the mean of the ith subgroup.
  2. the median of the ith subgroup.
  3. the 10% trimmed mean of the ith subgroup.
The definition used for Mi is determined by a LeveneStat.Mode argument in the constructor. If no such argument is provided, the mean is used as the default. Please see Levene Test for Equality of Variances for a full description of this test. There is one notation difference: this document uses a lower case 'z' instead of an upper case 'Z' to work around a bug in mathjax by using Unicode combining characters.
  • Constructor Details

    • LeveneStat

      public LeveneStat(double[]... data)
      Constructor.
      Parameters:
      data - arguments providing a series of data sets
    • LeveneStat

      public LeveneStat(LeveneStat.Mode mode, double[]... data)
      Constructor providing a mode.
      Parameters:
      mode - the mode (default to LeveneStat.Mode.MEAN if this argument is null), with valid modes being LeveneStat.Mode.MEAN, LeveneStat.Mode.MEDIAN, and LeveneStat.Mode.TRIMMED
      data - arguments providing a series of data sets
      See Also:
  • Method Details

    • getValue

      public double getValue()
      Description copied from class: Statistic
      Get the value of this statistic.
      Specified by:
      getValue in class Statistic
      Returns:
      the value of this statistic
    • optimalValue

      public double optimalValue()
      Description copied from class: Statistic
      Get the value for a statistic that indicates no deviation from the null hypothesis. The default is 0.0. It is unusual for this method to be overridden as standard statistics use 0.0 for this purpose.
      Overrides:
      optimalValue in class Statistic
      Returns:
      the value