Class MannWhitneyUTest.Result
java.lang.Object
org.apache.commons.statistics.inference.BaseSignificanceResult
org.apache.commons.statistics.inference.MannWhitneyUTest.Result
- All Implemented Interfaces:
SignificanceResult
- Enclosing class:
MannWhitneyUTest
Result for the Mann-Whitney U test.
This class is immutable.
- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanFlag indicating the data has tied values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the test statistic.booleanReturntrueif the data had tied values.Methods inherited from class org.apache.commons.statistics.inference.BaseSignificanceResult
getPValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.statistics.inference.SignificanceResult
reject
-
Field Details
-
tiedValues
private final boolean tiedValuesFlag indicating the data has tied values.
-
-
Constructor Details
-
Result
Result(double statistic, boolean tiedValues, double p) Create an instance.- Parameters:
statistic- Test statistic.tiedValues- Flag indicating the data has tied values.p- Result p-value.
-
-
Method Details
-
getStatistic
public double getStatistic()Returns the test statistic.This is the U1 statistic. Compute the U2 statistic using the original sample lengths
nandmusing:u2 = (long) n * m - u1;
- Specified by:
getStatisticin interfaceSignificanceResult- Overrides:
getStatisticin classBaseSignificanceResult- Returns:
- the statistic
-
hasTiedValues
public boolean hasTiedValues()Returntrueif the data had tied values.Note: The exact computation cannot be used when there are tied values.
- Returns:
trueif there were tied values
-