Initializing playground…
← Back to roadmap

Hypothesis Tests (scipy-style)

← tsb playground · t-tests, chi-square, ANOVA, normality, correlation, Mann-Whitney U, Kolmogorov-Smirnov

1 · One-sample t-test — ttest1samp

Test whether the mean of a sample equals a hypothesised population mean. Returns { statistic, pvalue }. Mirrors scipy.stats.ttest_1samp(a, popmean).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2 · One-sided t-test — alternative option

Use alternative: "greater" or "less" for one-tailed tests.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

3 · Independent t-test — ttestInd (Welch's)

Compare means of two independent groups. Defaults to Welch's t-test (unequal variances). Mirrors scipy.stats.ttest_ind.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

4 · Paired t-test — ttestRel

Compare measurements on the same subjects before and after an intervention. Mirrors scipy.stats.ttest_rel(a, b).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

5 · Chi-square test for independence — chi2Contingency

Test whether two categorical variables are independent using a contingency table. Mirrors scipy.stats.chi2_contingency.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

6 · One-way ANOVA — fOneway

Test whether two or more groups have equal population means. F = between-group variance / within-group variance. Mirrors scipy.stats.f_oneway(*groups).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

7 · Jarque-Bera normality test — jarqueBera

Test H₀: data is normally distributed, using sample skewness and kurtosis. JB ~ χ²(2) under H₀. Mirrors scipy.stats.jarque_bera(data).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

8 · Pearson correlation — pearsonr

Compute the Pearson product-moment correlation coefficient and its p-value (H₀: r = 0). Mirrors scipy.stats.pearsonr(x, y).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

9 · Spearman rank correlation — spearmanr

Non-parametric rank-based correlation. Robust to outliers and non-normal data. Mirrors scipy.stats.spearmanr(x, y).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

10 · Mann-Whitney U test — mannWhitneyU

Non-parametric alternative to the independent t-test. Tests whether one population tends to have larger values than another. Mirrors scipy.stats.mannwhitneyu.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

11 · Kolmogorov-Smirnov test — kstest

Test whether data follows a specified distribution (e.g. normal, uniform). D = max|F_n(x) − F(x)|. Mirrors scipy.stats.kstest(data, cdf).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent