## Class WilcoxonRankSum

• public class WilcoxonRankSum
extends HypothesisTest
The Wilcoxon rank sum test tests for the equality of means of two populations, or whether the means differ by an offset. That is, it tests the null hypothesis that the distribution x - y is symmetric about mu. This test is also called the Mann-Whitney-Wilcoxon, Mann-Whitney-U, or Wilcoxon-Mann-Whitney test.

The R equivalent function is wilcox.test.

Wikipedia: Mann-Whitney U
• ### Constructor Summary

Constructors
Constructor Description
WilcoxonRankSum​(double[] sample1, double[] sample2)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two populations.
WilcoxonRankSum​(double[] sample1, double[] sample2, double mu)
Perform the Wilcoxon Rank Sum test to test for the equality of means of two populations, or whether the means differ 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 populations, or whether the means differ 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 populations, or whether the means differ by an offset.
• ### Method Summary

All Methods
Modifier and Type Method Description
String getAlternativeHypothesis()
Get the description of the alternative hypothesis.
String getNullHypothesis()
Get a description of the null hypothesis.
double leftOneSidedPvalue()
Get the left, one-sided p-value.
double pValue()
Get the p-value for the test statistics.
double rightOneSidedPvalue()
Get the right, one-sided p-value.
double statistics()
Get the test statistics.
• ### Methods inherited from class dev.nm.stat.test.HypothesisTest

isNullRejected, nGroups, nObs, oneSidedPvalue
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### 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 populations, or whether the means differ 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 populations, or whether the means differ 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 populations, or whether the means differ by an offset. The exact distribution is used for sample size < 50.
Parameters:
sample1 - sample 1
sample2 - sample 2
mu - the hypothetical 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 populations.
Parameters:
sample1 - sample 1
sample2 - sample 2
• ### Method Detail

• #### getNullHypothesis

public String getNullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.
Specified by:
getNullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
Wikipedia: Null hypothesis
• #### getAlternativeHypothesis

public String getAlternativeHypothesis()
Description copied from class: HypothesisTest
Get the description of the alternative hypothesis.
Specified by:
getAlternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
Wikipedia: Alternative hypothesis
• #### statistics

public double statistics()
Description copied from class: HypothesisTest
Get the test statistics.
Specified by:
statistics in class HypothesisTest
Returns:
the test statistics
Wikipedia: Test statistic
• #### pValue

public double pValue()
Description copied from class: HypothesisTest
Get the p-value for the test statistics.
Specified by:
pValue in class HypothesisTest
Returns:
the p-value
public double rightOneSidedPvalue()
public double leftOneSidedPvalue()