SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.rank.wilcoxon
Class WilcoxonRankSum

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.test.rank.wilcoxon.WilcoxonRankSum

public class WilcoxonRankSum
extends HypothesisTest

The Wilcoxon rank sum test tests for the equality of means of two population, or whether the means differs by an offset. That is, it tests the null hypothesis that the distribution x - y is symmetric about mu.

This is also called the Mann–Whitney–Wilcoxon, Mann-Whitney-U, or Wilcoxon–Mann–Whitney test.

The R equivalent function is wilcox.test.

See Also:
Wikipedia: Mann–Whitney U

Field Summary
 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
WilcoxonRankSum(double[] sample1, double[] sample2)
          Perform the Wilcoxon Rank Sum test to test for the equality of means of two population.
WilcoxonRankSum(double[] sample1, double[] sample2, double mu)
          Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.
WilcoxonRankSum(double[] sample1, double[] sample2, double mu, boolean isExact)
          Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.
WilcoxonRankSum(double[] sample1, double[] sample2, double mu, boolean isExact, boolean isCorrected)
          Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 
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

pValue1SidedLess

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


pValue1SidedGreater

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

Constructor Detail

WilcoxonRankSum

public WilcoxonRankSum(double[] sample1,
                       double[] sample2,
                       double mu,
                       boolean isExact,
                       boolean isCorrected)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.

Parameters:
sample1 - sample 1
sample2 - sample 2
mu - the hypothetical location that the sample1 - sample2 is symmetric about
isExact - true if to use the exact distribution; otherwise, normal approximation is used
isCorrected - true if to use the continuity correction for the normal distribution; otherwise, standard normal approximation is used

WilcoxonRankSum

public WilcoxonRankSum(double[] sample1,
                       double[] sample2,
                       double mu,
                       boolean isExact)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.

Parameters:
sample1 - sample 1
sample2 - sample 2
mu - the hypothetical location that the sample1 - sample2 is symmetric about
isExact - true if to use the exact distribution; otherwise, normal approximation is used

WilcoxonRankSum

public WilcoxonRankSum(double[] sample1,
                       double[] sample2,
                       double mu)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two population, or whether the means differs by an offset.

The exact distribution is used for sample size < 50.

Parameters:
sample1 - sample 1
sample2 - sample 2
mu - the hypotheical location that the sample1 - sample2 is symmetric about

WilcoxonRankSum

public WilcoxonRankSum(double[] sample1,
                       double[] sample2)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two population.

Parameters:
sample1 - sample 1
sample2 - sample 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

SuanShu, a Java numerical and statistical library

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