Skip to main content
Module

x/simplestatistics/index.js>tTest

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

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.

Examples

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

Parameters

x

sample of one or more numbers

expectedValue

expected value of the population mean