Click or drag to resize
Accord.NET (logo) FTest Class
Snedecor's F-Test.
Inheritance Hierarchy
SystemObject
  Accord.Statistics.TestingHypothesisTestFDistribution
    Accord.Statistics.TestingFTest
      Accord.Statistics.TestingLeveneTest

Namespace:  Accord.Statistics.Testing
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.4.0
Syntax
[SerializableAttribute]
public class FTest : HypothesisTest<FDistribution>
Request Example View Source

The FTest type exposes the following members.

Constructors
  NameDescription
Protected methodFTest
Creates a new F-Test.
Public methodFTest(Double, Int32, Int32, TwoSampleHypothesis)
Creates a new F-Test for a given statistic with given degrees of freedom.
Public methodFTest(Double, Double, Int32, Int32, TwoSampleHypothesis)
Creates a new F-Test for a given statistic with given degrees of freedom.
Top
Properties
  NameDescription
Public propertyCriticalValue
Gets the critical value for the current significance level.
(Inherited from HypothesisTestTDistribution.)
Public propertyDegreesOfFreedom1
Gets the degrees of freedom for the numerator in the test distribution.
Public propertyDegreesOfFreedom2
Gets the degrees of freedom for the denominator in the test distribution.
Public propertyHypothesis
Gets the alternative hypothesis under test. If the test is Significant, the null hypothesis can be rejected in favor of this alternative hypothesis.
Public propertyPValue
Gets the P-value associated with this test.
(Inherited from HypothesisTestTDistribution.)
Public propertySignificant
Gets whether the null hypothesis should be rejected.
(Inherited from HypothesisTestTDistribution.)
Public propertySize
Gets the significance level for the test. Default value is 0.05 (5%).
(Inherited from HypothesisTestTDistribution.)
Public propertyStatistic
Gets the test statistic.
(Inherited from HypothesisTestTDistribution.)
Public propertyStatisticDistribution
Gets the distribution associated with the test statistic.
(Inherited from HypothesisTestTDistribution.)
Public propertyTail
Gets the test type.
(Inherited from HypothesisTestTDistribution.)
Top
Methods
  NameDescription
Protected methodCompute
Computes the F-test.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnSizeChanged
Called whenever the test significance level changes.
(Inherited from HypothesisTestTDistribution.)
Public methodPValueToStatistic
Converts a given p-value to a test statistic.
(Overrides HypothesisTestTDistributionPValueToStatistic(Double).)
Public methodStatisticToPValue
Converts a given test statistic to a p-value.
(Overrides HypothesisTestTDistributionStatisticToPValue(Double).)
Public methodToString
Converts the numeric P-Value of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.)
Public methodToString(String, IFormatProvider)
Converts the numeric P-Value of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by Matrix.)
Top
Remarks

A F-test is any statistical test in which the test statistic has an F-distribution under the null hypothesis. It is most often used when comparing statistical models that have been fit to a data set, in order to identify the model that best fits the population from which the data were sampled.

References:

Examples
// The following example has been based on the page "F-Test for Equality 
// of Two Variances", from NIST/SEMATECH e-Handbook of Statistical Methods:
// 
//  http://www.itl.nist.gov/div898/handbook/eda/section3/eda359.htm
// 

// Consider a data set containing 480 ceramic strength 
// measurements for two batches of material. The summary
// statistics for each batch are shown below:

// Batch 1:
int numberOfObservations1 = 240;
// double mean1 = 688.9987;
double stdDev1 = 65.54909;
double var1 = stdDev1 * stdDev1;

// Batch 2:
int numberOfObservations2 = 240;
// double mean2 = 611.1559;
double stdDev2 = 61.85425;
double var2 = stdDev2 * stdDev2;

// Here, we will be testing the null hypothesis that
// the variances for the two batches are equal.

int degreesOfFreedom1 = numberOfObservations1 - 1;
int degreesOfFreedom2 = numberOfObservations2 - 1;

// Now we can create a F-Test to test the difference between variances
var ftest = new FTest(var1, var2, degreesOfFreedom1, degreesOfFreedom2);

double statistic = ftest.Statistic; // 1.123037
double pvalue = ftest.PValue;       // 0.185191
bool significant = ftest.Significant; // false

// The F test indicates that there is not enough evidence 
// to reject the null hypothesis that the two batch variances
// are equal at the 0.05 significance level.
See Also