java.lang.Object
org.bzdev.math.stats.Statistic
org.bzdev.math.stats.FStat
org.bzdev.math.stats.LeveneStat
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
- the mean of the ith subgroup.
- the median of the ith subgroup.
- the 10% trimmed mean of the ith subgroup.
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.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bzdev.math.stats.Statistic
Statistic.PValueMode
-
Constructor Summary
ConstructorsConstructorDescriptionLeveneStat
(double[]... data) Constructor.LeveneStat
(LeveneStat.Mode mode, double[]... data) Constructor providing a mode. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getValue()
Get the value of this statistic.double
Get the value for a statistic that indicates no deviation from the null hypothesis.Methods inherited from class org.bzdev.math.stats.FStat
getDegreesOfFreedom1, getDegreesOfFreedom2, getDistribution, getDistribution, getNCParameter, getNCParameter, setDegreesOfFreedom, setSize
-
Constructor Details
-
LeveneStat
public LeveneStat(double[]... data) Constructor.- Parameters:
data
- arguments providing a series of data sets
-
LeveneStat
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.TRIMMEDdata
- 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. -
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 classStatistic
- Returns:
- the value
-