/** Result of {@link chi2Contingency}. */ export interface Chi2ContingencyResult { chi2: number; pValue: number; dof: number; expected: number[][]; cramersV: number; } /** Options for {@link chi2Contingency}. */ export interface Chi2ContingencyOptions { /** Apply the Yates continuity correction on 2x2 tables. Default true (matches scipy). */ correction?: boolean; } /** * Chi-square test of independence on a contingency table. * * Expected counts `E_ij = rowSum_i * colSum_j / total`. `chi2 = sum((O_ij - * E_ij)^2 / E_ij)`, with the Yates continuity correction * `(|O_ij - E_ij| - 0.5)^2 / E_ij` applied on 2x2 tables when * `opts.correction !== false` (default true, matching * `scipy.stats.chi2_contingency`). `dof = (rows - 1) * (cols - 1)`; `pValue = * 1 - chiSquaredCDF(chi2, dof)`. `cramersV = sqrt(chi2 / (total * * min(rows-1, cols-1)))`. * * Complementary to (NOT a duplicate of) `chiSquareTest`'s 2D form * (`typed/hypothesis.js`): `chiSquareTest` covers 1D goodness-of-fit plus a * plain 2D independence test, while `chi2Contingency` is the * `scipy.stats.chi2_contingency`-parity contingency test — it adds the Yates * continuity correction (2x2 tables) and returns the expected-frequency * table plus Cramér's V effect size that `chiSquareTest` does not. * * @example * chi2Contingency([[10, 20], [30, 40]], { correction: false }); * // { chi2: 0.7937, pValue: 0.373, dof: 1, expected: [[12, 18], [28, 42]], cramersV } */ export declare function chi2Contingency(table: readonly (readonly number[])[], opts?: Chi2ContingencyOptions): Chi2ContingencyResult; /** Supported multiple-testing correction methods. */ export type MultipleTestMethod = 'bonferroni' | 'holm' | 'bh'; /** * Multiple-testing p-value adjustment, returned in the original input order. * Matches `statsmodels.stats.multitest.multipletests`. * * - `bonferroni`: `min(1, p_i * n)`. * - `holm` (step-down): sort ascending; adjusted_(k) = `min(1, max_{j<=k} * (n - j + 1) * p_(j))`, enforced monotonic non-decreasing. * - `bh` (Benjamini-Hochberg FDR, step-up): sort ascending; adjusted_(k) = * `min(1, min_{j>=k} (n / j) * p_(j))`, enforced monotonic non-decreasing * from the largest p-value down. * * Same algorithm as `multipleComparison` (`typed/hypothesis.js`) — an * equivalent alias kept for the `statsmodels`-matching name; both names are * supported and always return identical results. * * @example multipleTest([0.01, 0.04, 0.5], 'bonferroni'); // [0.03, 0.12, 1] */ export declare function multipleTest(pValues: readonly number[], method: MultipleTestMethod): number[]; //# sourceMappingURL=inference-extra.d.ts.map