Fligner Killeen Test Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
public sealed class FlignerKilleenTest : MultiSampleTest<double>
- Inheritance
- Object → HypothesisTest → MultiSampleTest<Double> → FlignerKilleenTest
Remarks
Use the FlignerKilleenTest class to test whether a number of samples have the same variance. This property is called homogeneity of variance.
The null hypothesis of the Fligner-Killeen test is that all groups have the same variance. The test statistic is based on the ranks of absolute deviations from the group medians. This statistic follows a chi-square distribution.
The Fligner-Killeen test is a non-parametric test and is considered more robust than Levene's test or Bartlett's test when the data is not normally distributed.
The test works by using ranks of absolute deviations from the group medians, making it less sensitive to outliers and departures from normality.
Applications of the Fligner-Killeen test include comparing the variability of different groups in experimental data, quality control, and other fields where variance homogeneity is of interest.
For similar hypothesis tests, see LeveneTest and BartlettTest.
Example
The following example demonstrates how to use the FlignerKilleenTest class to perform the test with non-trivial inputs and then shows using its properties and methods.
using Numerics.NET.DataAnalysis;
using Numerics.NET.Statistics;
using Numerics.NET.Statistics.Tests;
// Example for the constructor with no arguments
Vector<double>[] samples =
{
[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 2.0 ],
[ 2.0, 3.0, 4.0, 5.0, 4.0, 3.0, 2.0, 2.0 ],
[ 3.0, 4.0, 5.0, 4.0, 5.0, 4.0, 3.0, 2.0 ]
};
FlignerKilleenTest test1 = new FlignerKilleenTest(samples);
double statistic1 = test1.CalculateStatistic();
double pValue1 = test1.GetPValue(HypothesisType.OneTailedUpper);
Console.WriteLine($"Statistic: {statistic1}, P-Value: {pValue1}");
// Example for the constructor with vector array and grouping
Vector<double> sampleData = [ 1.0, 2.0, 3.0, 2.0, 3.0, 4.0, 3.0, 4.0, 5.0 ];
var grouping = Grouping.ByQuantile(sampleData, 3);
FlignerKilleenTest test2 = new FlignerKilleenTest(sampleData, grouping);
double statistic2 = test2.CalculateStatistic();
double pValue2 = test2.GetPValue(HypothesisType.OneTailedUpper);
Console.WriteLine($"Statistic: {statistic2}, P-Value: {pValue2}");
Constructors
Fligner | Constructs a new FlignerKilleenTest. |
Fligner | Constructs a new FlignerKilleenTest for the samples in a data frame. |
Fligner | Constructs a new FlignerKilleenTest for the specified vector array. |
Fligner | Constructs a new FlignerKilleenTest for the specified vector array. |
Properties
Degrees | Gets the degrees of freedom of the chi-square distribution. |
Distribution |
Gets the probability distribution used in the hypothesis test.
(Inherited from HypothesisTest) |
Fraction | Gets or sets the fraction of the data to trim from each end of the sample when the trimmed mean is set as the LocationMeasure. |
Grouping |
Gets the grouping that divides Sample into groups.
(Inherited from MultiSampleTest<T>) |
Hypothesis |
Gets or sets whether the test is one or two-tailed.
(Inherited from HypothesisTest) |
Location | Gets or sets the location measure used by this test. |
Name |
Gets the name of the hypothesis test.
(Overrides HypothesisTest.Name) |
PValue |
Gets the probability that the test statistic would take on the calculated value under the alternate hypothesis.
(Inherited from HypothesisTest) |
Sample |
Gets the vector that contains the sample data.
(Inherited from MultiSampleTest<T>) |
Samples |
Gets the collection of samples for the test.
(Inherited from MultiSampleTest<T>) |
Significance |
Gets the significance level used to test the null hypothesis.
(Inherited from HypothesisTest) |
Statistic |
Gets the value of the test statistic.
(Inherited from HypothesisTest) |
Methods
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Returns the confidence interval for the test parameter for the default confidence level.
(Inherited from HypothesisTest) |
Get |
Returns the confidence interval for the test parameter for the specified confidence level.
(Inherited from HypothesisTest) |
Get | Serves as the default hash function. (Inherited from Object) |
Get |
Gets the lower critical value for the hypothesis test's current significance level.
(Inherited from HypothesisTest) |
Get |
Gets the lower critical value for the hypothesis test at the specified significance level.
(Inherited from HypothesisTest) |
Get |
Gets the probability that the test statistic would take on the calculated value under the specified alternate hypothesis.
(Inherited from HypothesisTest) |
Get | Gets the Type of the current instance. (Inherited from Object) |
Get |
Gets the upper critical value for the test statistic at the hypothesis test's current significance level.
(Inherited from HypothesisTest) |
Get |
Gets the upper critical value for the test statistic at the specified significance level.
(Inherited from HypothesisTest) |
Reject() |
Returns whether the null hypothesis is rejected
using the default significance level.
(Inherited from HypothesisTest) |
Reject( |
Returns whether the null hypothesis is rejected using the specified significance level.
(Inherited from HypothesisTest) |
Summarize() |
Returns a string containing a human-readable summary of the object.
(Inherited from HypothesisTest) |
Summarize( |
Returns a string containing a human-readable summary of the object
using the specified options.
(Inherited from HypothesisTest) |
ToString | Returns a string that represents the current object. (Inherited from HypothesisTest) |