import { permutationTest } from "https://deno.land/x/simplestatistics@v7.8.3/index.js";
Conducts a permutation test to determine if two data sets are significantly different from each other, using the difference of means between the groups as the test statistic. The function allows for the following hypotheses:
- two_tail = Null hypothesis: the two distributions are equal.
- greater = Null hypothesis: observations from sampleX tend to be smaller than those from sampleY.
- less = Null hypothesis: observations from sampleX tend to be greater than those from sampleY. Learn more about one-tail vs two-tail tests.
Examples
var control = [2, 5, 3, 6, 7, 2, 5];
var treatment = [20, 5, 13, 12, 7, 2, 2];
permutationTest(control, treatment); // ~0.1324
var control = [2, 5, 3, 6, 7, 2, 5]; var treatment = [20, 5, 13, 12, 7, 2, 2]; permutationTest(control, treatment); // ~0.1324