oneSampleTTest(
sample,expectedMean,options?):OneSampleTTestResult
Defined in: packages/hypothesis-test/src/one-sample-t-test.ts:21
Student’s t-test of whether a sample’s mean equals expectedMean, matching scipy.stats.ttest_1samp. The statistic
is (mean - expectedMean) / sqrt(variance / n) with n - 1 degrees of freedom. greater tests a mean above
expectedMean. Uses O(n) time and constant working storage.
A constant sample has zero variance. SciPy returns NaN or an infinite statistic there; this function throws.
Parameters
Section titled “Parameters”sample
Section titled “sample”ArrayLike<number>
expectedMean
Section titled “expectedMean”number
options?
Section titled “options?”Returns
Section titled “Returns”Throws
Section titled “Throws”With EMPTY_SAMPLE, TOO_SMALL_SAMPLE below two values,
NON_FINITE_SAMPLE (also for a non-finite expectedMean), ZERO_VARIANCE, or INVALID_OPTION.
Throws
Section titled “Throws”With INVALID_PARAMETER above 1e5 degrees of freedom.