Skip to main content
Module

x/simplestatistics/index.js>wilcoxonRankSum

simple statistics for node & browser javascript
Go to Latest
function wilcoxonRankSum
import { wilcoxonRankSum } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

This function calculates the Wilcoxon rank sum statistic for the first sample with respect to the second. The Wilcoxon rank sum test is a non-parametric alternative to the t-test which is equivalent to the Mann-Whitney U test. The statistic is calculated by pooling all the observations together, ranking them, and then summing the ranks associated with one of the samples. If this rank sum is sufficiently large or small we reject the hypothesis that the two samples come from the same distribution in favor of the alternative that one is shifted with respect to the other.

Examples

wilcoxonRankSum([1, 4, 8], [9, 12, 15]); // => 6

Parameters

sampleX

a sample as an array of numbers

sampleY

a sample as an array of numbers