Skip to main content

Module hypothesis_tests

Module hypothesis_tests 

Source
Expand description

Classical hypothesis tests.

See the book entry Hypothesis tests.

Structs§

TestResult
A test statistic with its p-value.

Enums§

Alternative
The alternative hypothesis.

Functions§

anova_one_way
One-way analysis of variance: the F test of equal group means, on (k − 1, N − k) degrees of freedom (reported as the between-groups value; the within-groups one is N − k).
chi_square_goodness_of_fit
Pearson’s chi-square goodness-of-fit test of observed counts against expected frequencies (uniform when None; rescaled to the observed total), on k − 1 degrees of freedom.
chi_square_independence
Pearson’s chi-square test of independence for an r × c contingency table (no continuity correction), on (r − 1)(c − 1) degrees of freedom.
kolmogorov_survival
The Kolmogorov distribution’s survival function Q(λ) = 2 Σ (−1)^{k−1} e^{−2k²λ²}.
ks_test_one_sample
The one-sample Kolmogorov-Smirnov test of x against a continuous cdf: D = sup |F_n − F|, with the asymptotic p-value Q((√n + 0.12 + 0.11/√n) D) (Stephens).
ks_test_two_sample
The two-sample Kolmogorov-Smirnov test. The p-value is the asymptotic Q((√nₑ + 0.12 + 0.11/√nₑ) D) with the effective size nₑ = nm / (n + m), borrowing Stephens’ one-sample correction; for small samples it can differ from the exact p-value by several per cent (7% for samples of 15 and 25).
mann_whitney_u
The Mann-Whitney U test (Wilcoxon rank-sum) for a location shift between two samples. The statistic is U of the first sample; the p-value uses the normal approximation with tie and continuity corrections (adequate for samples above about 10 each).
t_test_one_sample
One-sample Student t-test of the mean against mu.
t_test_paired
Paired t-test: the one-sample test on the differences x − y.
t_test_two_sample
Two-sample t-test of equal means: Student’s pooled-variance test with equal_variance, otherwise Welch’s test with the Welch-Satterthwaite degrees of freedom.