Skip to content

tTest

tTest(x, expectedValue): number

Defined in: src/t_test.js:21

This is to compute a one-sample t-test, comparing the mean of a sample to a known value, x.

in this case, we’re trying to determine whether the population mean is equal to the value that we know, which is x here. 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.

number[]

sample of one or more numbers

number

expected value of the population mean

number

value

tTest([1, 2, 3, 4, 5, 6], 3.385).toFixed(2); // => '0.16'