Skip to main content
Module

x/simplestatistics/index.js>tTestTwoSample

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

This is to compute two sample t-test. Tests whether "mean(X)-mean(Y) = difference", ( in the most common case, we often have difference == 0 to test if two samples are likely to be taken from populations with the same mean value) with no prior knowledge on standard deviations of both samples other than the fact that they have the same standard deviation.

Usually the results here are used to look up a p-value, which, for a certain level of significance, will let you determine that the null hypothesis can or cannot be rejected.

diff can be omitted if it equals 0.

This is used to reject a null hypothesis that the two populations that have been sampled into sampleX and sampleY are equal to each other.

Examples

tTestTwoSample([1, 2, 3, 4], [3, 4, 5, 6], 0); // => -2.1908902300206643

Parameters

sampleX

a sample as an array of numbers

sampleY

a sample as an array of numbers

difference