wilcoxonRankSum
wilcoxonRankSum(
sampleX,sampleY):number
Defined in: src/wilcoxon_rank_sum.js:19
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.
Parameters
Section titled “Parameters”sampleX
Section titled “sampleX”number[]
a sample as an array of numbers
sampleY
Section titled “sampleY”number[]
a sample as an array of numbers
Returns
Section titled “Returns”number
rank sum for sampleX
Example
Section titled “Example”wilcoxonRankSum([1, 4, 8], [9, 12, 15]); // => 6