Stats 0.5.0 tests - CyrilB1531/lodestar GitHub Wiki

Lodestar.Stats 0.5.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Home › Overview

Hypothesis tests — Lodestar.Stats

Eighteen families of classical hypothesis test, at scipy.stats 1.18.1 parity. Arrays in, a statistic and a p-value out; nothing is fitted, so every entry point is static.

test what it asks entry point
Student / Welch t do two samples have the same mean? TTest
Mann-Whitney U the same question, assuming no shape MannWhitney
Wilcoxon signed-rank the same, on paired measurements Wilcoxon
χ² do counts match an expected distribution, or are two factors independent? ChiSquare
Fisher exact the same for a 2×2 table, at any sample size FisherExact
Kolmogorov-Smirnov do two samples share a distribution? KolmogorovSmirnov
one-way ANOVA do several groups share one mean? OneWayAnova
Kruskal-Wallis the same, assuming no shape KruskalWallis
Shapiro-Wilk could this sample be normal? ShapiroWilk
Bonferroni / BH / BY how many of these results are chance? MultipleComparisons
Pearson r are these two variables related, along a line? Pearson
Spearman rho the same, along any rising or falling curve Spearman
Kendall tau the same, counted pair by pair KendallTau
Levene do several groups share one variance? Levene
Bartlett the same, assuming each group is normal Bartlett
Friedman do several treatments differ on the same subjects? Friedman
binomial is this proportion what it was said to be? Binomial
Anderson-Darling could this sample be normal? AndersonDarling

Every family but six returns the same two numbers, TestResult; a t-test also carries its degrees of freedom (TTestResult), a contingency table also carries the table independence would have produced (Chi2ContingencyResult), Kolmogorov-Smirnov also carries where and in which direction the two samples parted furthest (KsResult), a Pearson correlation and a binomial test each carry what their intervals need (PearsonResult, BinomialResult), and Anderson-Darling carries the table its statistic is read against (AndersonResult).

result carries returned by
TestResult a statistic, a p-value twelve of the eighteen families
TTestResult + degrees of freedom, a confidence interval TTest
Chi2ContingencyResult + degrees of freedom, the expected table ChiSquare.Contingency
KsResult + where the gap was reached, and its sign KolmogorovSmirnov
PearsonResult + a confidence interval for the correlation Pearson
BinomialResult + a confidence interval for the proportion Binomial
AndersonResult + the critical values and their significance levels AndersonDarling

Eight small enums choose what a test asks, and how it answers when the exact and the approximate route disagree.

option chooses
Alternative which tail the p-value covers
Variance whether an independent-samples t-test pools the two variances
Continuity whether a discrete statistic's normal approximation gets the half-unit correction
ExactMethod the exact null distribution, its normal approximation, or a choice between them
ZeroMethod what Wilcoxon does with a pair whose difference is exactly zero
KendallVariant which normalisation Kendall's tau carries; the p-value is the same either way
Center which centre Levene's test measures each group's spread around
ProportionInterval which interval a binomial proportion is reported with

The hypothesis-testing guide says which test answers which question, and the Python equivalence table maps each scipy call to its counterpart here.