public class MannWhitneyU
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MannWhitneyU.RankedData
The ranked data in one list and a list of the number of ties.
|
static class |
MannWhitneyU.Result
The results of performing a rank sum test.
|
static class |
MannWhitneyU.TestStatistic
The values of U1, U2 and the transformed number of ties needed for the calculation of sigma
in the normal approximation.
|
static class |
MannWhitneyU.TestType
A variable that indicates if the test is one sided or two sided and if it's one sided
which group is the dominator in the null hypothesis.
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
logger |
Constructor and Description |
---|
MannWhitneyU() |
Modifier and Type | Method and Description |
---|---|
MannWhitneyU.TestStatistic |
calculateOneSidedU(double[] series1,
double[] series2,
MannWhitneyU.TestType whichSeriesDominates)
Calculates the rank-sum test statisic U (sometimes W) from two sets of input data for a one-sided test
with an int indicating which group is the dominator.
|
MannWhitneyU.RankedData |
calculateRank(double[] series1,
double[] series2) |
MannWhitneyU.TestStatistic |
calculateTwoSidedU(double[] series1,
double[] series2)
Calculates the two-sided rank-sum test statisic U (sometimes W) from two sets of input data.
|
MannWhitneyU.TestStatistic |
calculateU1andU2(double[] series1,
double[] series2)
Rank both groups together and return a TestStatistic object that includes U1, U2 and number of ties for sigma
|
double |
calculateZ(double u,
int n1,
int n2,
double nties,
MannWhitneyU.TestType whichSide)
Calculates the Z score (i.e.
|
double |
median(double[] data)
Finds or calculates the median value of a sorted array of double.
|
double |
permutationTest(double[] series1,
double[] series2,
double testStatU)
Creates histogram of test statistics from a permutation test.
|
void |
setMinimumSeriesLengthForNormalApproximation(int n)
Sets the minimum number of values in each data series to use the normal distribution approximation.
|
MannWhitneyU.Result |
test(double[] series1,
double[] series2,
MannWhitneyU.TestType whichSide)
Constructs a new rank sum test with the given data.
|
double |
transformTies(int numOfRanks,
java.util.ArrayList<java.lang.Integer> numOfTies) |
public void setMinimumSeriesLengthForNormalApproximation(int n)
public MannWhitneyU.RankedData calculateRank(double[] series1, double[] series2)
public MannWhitneyU.TestStatistic calculateU1andU2(double[] series1, double[] series2)
public double transformTies(int numOfRanks, java.util.ArrayList<java.lang.Integer> numOfTies)
public MannWhitneyU.TestStatistic calculateOneSidedU(double[] series1, double[] series2, MannWhitneyU.TestType whichSeriesDominates)
public MannWhitneyU.TestStatistic calculateTwoSidedU(double[] series1, double[] series2)
public double calculateZ(double u, int n1, int n2, double nties, MannWhitneyU.TestType whichSide)
public double median(double[] data)
public MannWhitneyU.Result test(double[] series1, double[] series2, MannWhitneyU.TestType whichSide)
series1
- group 1 dataseries2
- group 2 datawhichSide
- indicator of two sided test, 0 for two sided, 1 for series1 as dominator, 2 for series2 as dominatorpublic double permutationTest(double[] series1, double[] series2, double testStatU)
series1
- Data from group 1series2
- Data from group 2testStatU
- Test statistic U from observed data