Skip to main content

Kotlin Notebook

Try this guide as a Kotlin Notebook with Kandy visualizations — run the cells to see charts and explore the data interactively.
Parametric methods (t-tests, ANOVA, Pearson correlation) assume specific properties of the data. This guide covers the three most common assumptions and the kstats functions for each.

Normality

Available tests

Run all four on the same dataset

When tests disagree, prefer Shapiro-Wilk for small to medium samples and Anderson-Darling when tail behavior matters.

Combine with descriptive statistics

Variance Homogeneity

When comparing groups (t-test, ANOVA), equal variances are often assumed.

Check variances before ANOVA

A high p-value from all three tests supports proceeding with ANOVA or equal-variance t-test.

Then run ANOVA

Goodness-of-Fit

Kolmogorov-Smirnov test

Compare observed data against a theoretical distribution.

Chi-squared goodness-of-fit

Test whether observed category counts match expected proportions.

Two-sample KS test

Compare two samples without assuming a specific distribution.
Last modified on April 18, 2026