Tabnine Logo
MannWhitneyUTest
Code IndexAdd Tabnine to your IDE (free)

How to use
MannWhitneyUTest
in
org.apache.commons.math3.stat.inference

Best Java code snippets using org.apache.commons.math3.stat.inference.MannWhitneyUTest (Showing top 8 results out of 315)

origin: org.apache.commons/commons-math3

ConvergenceException, MaxCountExceededException {
ensureDataConformance(x, y);
final double Umax = mannWhitneyU(x, y);
return calculateAsymptoticPValue(Umin, x.length, y.length);
origin: org.apache.commons/commons-math3

throws NullArgumentException, NoDataException {
ensureDataConformance(x, y);
final double[] z = concatenateSamples(x, y);
final double[] ranks = naturalRanking.rank(z);
origin: org.apache.solr/solr-solrj

 @Override
 public Object doWork(Object... values) throws IOException {
  List<double[]> mannWhitneyUInput = Arrays.stream(values)
    .map(value -> ((List<Number>) value).stream().mapToDouble(Number::doubleValue).toArray())
    .collect(Collectors.toList());
  if(mannWhitneyUInput.size() == 2) {
   MannWhitneyUTest mannwhitneyutest = new MannWhitneyUTest();
   double u = mannwhitneyutest.mannWhitneyU(mannWhitneyUInput.get(0), mannWhitneyUInput.get(1));
   double p = mannwhitneyutest.mannWhitneyUTest(mannWhitneyUInput.get(0), mannWhitneyUInput.get(1));
   Map<String,Number> m = new HashMap<>();
   m.put("u-statistic", u);
   m.put("p-value", p);
   return new Tuple(m);
  }else{
   throw new IOException(String.format(Locale.ROOT,"%s(...) only works with a list of 2 arrays but a list of %d array(s) was provided.", constructingFactory.getFunctionName(getClass()), mannWhitneyUInput.size()));
  }
 }
}
origin: SurveyMan/SurveyMan

/**
 * Mann-Whitney statistic, specialized for comparing survey questions.
 * @param q1
 * @param q2
 * @param list1
 * @param list2
 * @return
 */
public static ImmutablePair<Double, Double> mannWhitney(Question q1, Question q2, List<SurveyDatum> list1, List<SurveyDatum> list2) {
  if (list1.size()==0 || list2.size()==0) {
    SurveyMan.LOGGER.warn(String.format("Cannot compare response lists of sizes: %d and %d", list1.size(), list2.size()));
    return new ImmutablePair<>(-0.0, -0.0);
  }
  // make ranks on the basis of the source row index
  Collections.sort(list1);
  Collections.sort(list2);
  double[] list1ranks = new double[list1.size()];
  double[] list2ranks = new double[list2.size()];
  for (int i = 0 ; i < list1.size() ; i++)
    list1ranks[i] = (double) list1.get(i).getSourceRow() - q1.getSourceRow() + 1;
  for (int i = 0 ; i < list2.size() ; i++)
    list2ranks[i] = (double) list2.get(i).getSourceRow() - q2.getSourceRow() + 1;
  // default constructor for mann whitney averages ties.
  MannWhitneyUTest test = new MannWhitneyUTest();
  double testStatistic = test.mannWhitneyU(list1ranks, list2ranks);
  double pvalue = test.mannWhitneyUTest(list1ranks, list2ranks);
  return new ImmutablePair<>(testStatistic, pvalue);
}
origin: geogebra/geogebra

ConvergenceException, MaxCountExceededException {
ensureDataConformance(x, y);
final double Umax = mannWhitneyU(x, y);
return calculateAsymptoticPValue(Umin, x.length, y.length);
origin: geogebra/geogebra

throws NullArgumentException, NoDataException {
ensureDataConformance(x, y);
final double[] z = concatenateSamples(x, y);
final double[] ranks = naturalRanking.rank(z);
origin: io.virtdata/virtdata-lib-realer

ConvergenceException, MaxCountExceededException {
ensureDataConformance(x, y);
final double Umax = mannWhitneyU(x, y);
return calculateAsymptoticPValue(Umin, x.length, y.length);
origin: io.virtdata/virtdata-lib-realer

throws NullArgumentException, NoDataException {
ensureDataConformance(x, y);
final double[] z = concatenateSamples(x, y);
final double[] ranks = naturalRanking.rank(z);
org.apache.commons.math3.stat.inferenceMannWhitneyUTest

Javadoc

An implementation of the Mann-Whitney U test (also called Wilcoxon rank-sum test).

Most used methods

  • mannWhitneyU
    Computes the Mann-Whitney U statistic [http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U] comparin
  • calculateAsymptoticPValue
  • concatenateSamples
    Concatenate the samples into one array.
  • ensureDataConformance
    Ensures that the provided arrays fulfills the assumptions.
  • <init>
    Create a test instance using the given strategies for NaN's and ties. Only use this if you are sure
  • mannWhitneyUTest
    Returns the asymptotic observed significance level, or p-value [http://www.cas.lancs.ac.uk/glossary_

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Path (java.nio.file)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JCheckBox (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now