/** * Calculates [Welch's two-sample t-test]{@link https://en.wikipedia.org/wiki/Welch%27s_t-test} for two data sets. * * @method welch * @memberof ran.test * @param {number[]} x First sample. * @param {number[]} y Second sample. * @param {number} [alpha = 0.05] Confidence level. * @returns {{stat: number, passed: boolean}} Object containing the test statistic (t) and whether the data * sets passed the null hypothesis that their means are equal. * @throws {Error} If either sample has fewer than 2 elements. * @example * * let normal1 = new ran.dist.Normal(0, 1) * let normal2 = new ran.dist.Normal(5, 1) * * ran.test.welch(normal1.sample(100), normal1.sample(100)) * // => { stat: -0.43, passed: true } * * ran.test.welch(normal1.sample(100), normal2.sample(100)) * // => { stat: -49.3, passed: false } */ export default function (x: number[], y: number[], alpha?: number): { stat: number; passed: boolean; };