Skip to content

pairedTTest(first, second, options?): PairedTTestResult

Defined in: packages/hypothesis-test/src/paired-t-test.ts:21

Paired-sample t-test of whether the mean of first[i] - second[i] is zero, matching scipy.stats.ttest_rel. It is oneSampleTTest of the differences against zero. greater tests a first mean above the second. Uses O(n) time and space.

Constant differences have zero variance. SciPy returns NaN or an infinite statistic there; this function throws.

ArrayLike<number>

ArrayLike<number>

PairedTTestOptions

PairedTTestResult

With EMPTY_SAMPLE, LENGTH_MISMATCH, TOO_SMALL_SAMPLE below two pairs, NON_FINITE_SAMPLE (also when a difference overflows), ZERO_VARIANCE, or INVALID_OPTION.

With INVALID_PARAMETER above 1e5 degrees of freedom.