F-test and chi-square test
|
Tests represented on this page are used to check hypotheses about random variables dispersion.
One sample chi-square test
This test is used to check hypotheses about the fact that dispersion of random variable X represented by sample xS equals given σ 2.
During its work, the test calculates the c-statistic:

If X has a normal distribution, the c-statistic will have a chi-square distribution with N-1 degrees of freedom. To define the significance level which corresponds to the value of c-statistic high-precision chi-square distribution approximation is used. Test returns three p-values:
- p-value for two-tailed test (null hypothesis - the dispersion is equal to the given number)
- p-value for left-tailed test (null hypothesis - the dispersion is greater than or equal to the given number)
- p-value for right-tailed test (null hypothesis - the dispersion is less than or equal to the given number)
Two-sample F-test
This test checks hypotheses about the fact that the dispersions of two random variables X and Y which are represented by samples xS and yS are equal. The test works correctly under the following conditions:
- both random variables have a normal distribution
- the samples are independent
During its work, the test calculates the F-statistic:

If X and Y have a normal distribution, the F-statistic will have F-distribution with NX -1 and NY -1 degrees of freedom. To define the significance level which corresponds to the value of F-statistic high-precision, F-distribution approximation is used.
Test returns three p-values:
- p-value for two-tailed test (null hypothesis - the dispersions are equal)
- p-value for left-tailed test (null hypothesis - the dispersion of the first sample is greater than or equal to the dispersion of the second sample)
- p-value for right-tailed test (null hypothesis - the dispersion of the first sample is less than or equal to the dispersion of the second sample)
Links- 'Hypothesis testing', Wikipedia
- 'P-value', Wikipedia
Report a bug
C#
C# 1.0 source.
variancetests.csharp.zip - F-test and chi-square test
C++
C++ source.
variancetests.cpp.zip - F-test and chi-square test
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)
Delphi
Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
variancetests.delphi.zip - F-test and chi-square test
Visual Basic 6
Visual Basic 6 source.
variancetests.vb6.zip - F-test and chi-square test
Zonnon beta
Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
variancetests.zonnon.zip - F-test and chi-square test
|