
Java Statistical Classes  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +jsc.independentsamples.MannWhitneyTest
This class represents a MannWhitney test. Suppose we have two independent samples from populations A and B. This tests the null hypothesis that A and B have the same distribution against the alternative hypotheses that A and B are different (NOT_EQUAL), or A is stochastically less than B (LESS_THAN), or A is stochastically greater than B (GREATER_THAN).
Constructor Summary  
MannWhitneyTest(double[] xA,
double[] xB)
Create significance test results. 

MannWhitneyTest(double[] xA,
double[] xB,
H1 alternative)
Create significance test results. 

MannWhitneyTest(double[] xA,
double[] xB,
H1 alternative,
double tolerance,
boolean normalApprox)
Create significance test results. 
Method Summary  
double 
approxSP()
Calculate the approximate significance probability of the test statistic using the normal approximation. 
double 
exactSP()
Calculate the exact significance probability of the test statistic. 
int 
getCorrectionFactor()
Return correction factor for ties. 
Enumerator 
getEnumerator()
Returns a MultiSetPermutations enumerator for generating all possible permutations
of the twosample data. 
int 
getN()
Returns the number of observations used to calculate the statistic. 
Rank 
getRanks()
Returns the ranks of the combined samples. 
double 
getRankSumA()
Returns sum of ranks of sample A. 
double 
getRankSumB()
Returns sum of ranks of sample B. 
double 
getSP()
Returns the value of the significance probability. 
double 
getStatistic()
Returns value of the MannWhitney test statistic, U. 
double 
getTestStatistic()
Returns value of the MannWhitney test statistic, U. 
double 
getZ()
Calculate the approximate normal test statistic, z. 
double 
permuteStatistic(Selection msp)
Calculate the value of the statistic for a "permutation" of its original data. 
double 
resampleStatistic(double[] ranksA)
Calculates the value of the MannWhitney statistic for ranks of one of two samples. 
int 
sizeA()

int 
sizeB()

Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public MannWhitneyTest(double[] xA, double[] xB, H1 alternative, double tolerance, boolean normalApprox)
For very large sample sizes the time taken to calculate the exact distribution of the MannWhitney Ustatistic can be excessive: the option of using a normal approximation is therefore provided.
xA
 the data of sample A.xB
 the data of sample B.alternative
 code indicating the alternative hypothesis: LESS_THAN, NOT_EQUAL, or GREATER_THANtolerance
 the tolerance for tied ranks: two values are treated as
equal if the absolute difference between them is less than or equal to this.normalApprox
 if true, a normal approximation is used to calculate the significance probability.
IllegalArgumentException
 if less than 2 values in either sample.public MannWhitneyTest(double[] xA, double[] xB, H1 alternative)
xA
 the data of sample A.xB
 the data of sample B.alternative
 code indicating the alternative hypothesis: LESS_THAN, NOT_EQUAL, or GREATER_THAN
IllegalArgumentException
 if less than 2 values in either sample.public MannWhitneyTest(double[] xA, double[] xB)
xA
 the data of sample A.xB
 the data of sample B.Method Detail 
public double approxSP()
public double exactSP()
Note that exact SP and critical values for small samples with no ties can also be obtained from the
MannWhitneyU
class.
public int getCorrectionFactor()
public Enumerator getEnumerator()
MultiSetPermutations
enumerator for generating all possible permutations
of the twosample data.
getEnumerator
in interface PermutableStatistic
public int getN()
Statistic
getN
in interface Statistic
public Rank getRanks()
public double getRankSumA()
public double getRankSumB()
public double getSP()
getSP
in interface SignificanceTest
public double getStatistic()
getStatistic
in interface Statistic
public double getTestStatistic()
getTestStatistic
in interface SignificanceTest
public double getZ()
public double permuteStatistic(Selection msp)
PermutableStatistic
permuteStatistic
in interface PermutableStatistic
msp
 the permutation.
public double resampleStatistic(double[] ranksA)
ranksA
 ranks of sample A.
public int sizeA()
public int sizeB()

Java Statistical Classes  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 