SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.variance
Class F

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.test.variance.F

public class F
extends HypothesisTest

The FDistribution-test tests whether two normal populations have the same variance. This test is sensitive to the assumption that the variables are normally distributed.

The R equivalent function is var.test.

See Also:
Wikipedia: FDistribution-test of equality of variances

Field Summary
 double df1
          the degree of freedoms
 double df2
          the degree of freedoms
 double estimate
          the estimate of the ratio of two variances
 UnivariateDistribution F
          the associated FDistribution distribution
 double pValue1SidedGreater
          right, one-sided p-value
 double pValue1SidedLess
          left, one-sided p-value
 
Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
k, N, pValue, testStatistics
 
Constructor Summary
F(double[] sample1, double[] sample2)
          Perform the FDistribution test to test for equal variance of two normal populations.
F(double[] sample1, double[] sample2, double ratio)
          Perform the FDistribution test to test for equal variance of two normal populations.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 double[] confidenceInterval(double confidence)
          Compute the confidence interval.
 double leftConfidenceInterval(double confidence)
          Compute the one sided left confidence interval, [0, a]
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 double rightConfidenceInterval(double confidence)
          Compute the one sided right confidence interval, [a, ∞)
 
Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
oneSidedPvalue, pValue, rejectNull, testStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

df1

public final double df1
the degree of freedoms


df2

public final double df2
the degree of freedoms


estimate

public final double estimate
the estimate of the ratio of two variances


pValue1SidedLess

public final double pValue1SidedLess
left, one-sided p-value


pValue1SidedGreater

public final double pValue1SidedGreater
right, one-sided p-value


F

public final UnivariateDistribution F
the associated FDistribution distribution

Constructor Detail

F

public F(double[] sample1,
         double[] sample2)
Perform the FDistribution test to test for equal variance of two normal populations.

Parameters:
sample1 - sample 1
sample2 - sample 2

F

public F(double[] sample1,
         double[] sample2,
         double ratio)
Perform the FDistribution test to test for equal variance of two normal populations.

Parameters:
sample1 - sample 1
sample2 - sample 2
ratio - the hypothesized ratio of the population variances of samples 1 and 2
Method Detail

nullHypothesis

public java.lang.String nullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.

Specified by:
nullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
See Also:
Wikipedia: Null hypothesis

alternativeHypothesis

public java.lang.String alternativeHypothesis()
Description copied from class: HypothesisTest
Get a description of the alternative hypothesis.

Specified by:
alternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
See Also:
Wikipedia: Alternative hypothesis

confidenceInterval

public double[] confidenceInterval(double confidence)
Compute the confidence interval.

Parameters:
confidence - the confidence level, e.g., for a 2-sided 95% confidence interval, we use 0.975 because 1 - 0.95 = 2 * (1 - 0.025)
Returns:
the left and right interval values

rightConfidenceInterval

public double rightConfidenceInterval(double confidence)
Compute the one sided right confidence interval, [a, ∞)

Parameters:
confidence - the confidence level, e.g., 0.95 for 95% confidence interval
Returns:
the left interval value

leftConfidenceInterval

public double leftConfidenceInterval(double confidence)
Compute the one sided left confidence interval, [0, a]

Parameters:
confidence - the confidence level, e.g., 0.95 for 95% confidence interval
Returns:
the right interval value

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.