Skip to content

welchTTest(first, second, options?): WelchTTestResult

Defined in: packages/hypothesis-test/src/welch-t-test.ts:23

Welch’s unequal-variance t-test of whether two independent samples share a mean, matching scipy.stats.ttest_ind(first, second, equal_var=False). The statistic is (mean₁ - mean₂) / sqrt(s₁²/m + s₂²/n), and the degrees of freedom follow Welch–Satterthwaite, so they are usually fractional. greater tests a first mean above the second. Uses O(m + n) time and constant working storage.

Two constant samples have zero standard error. SciPy returns NaN or an infinite statistic there; this function throws. One constant sample alongside a varying one is accepted.

ArrayLike<number>

ArrayLike<number>

WelchTTestOptions

WelchTTestResult

With EMPTY_SAMPLE, TOO_SMALL_SAMPLE below two values in either sample, NON_FINITE_SAMPLE, ZERO_VARIANCE, or INVALID_OPTION.

With INVALID_PARAMETER above 1e5 degrees of freedom.