Compare groups without assuming a normal distribution — rank-based tests.
Your browser does not support embedded video. Download the video (MP4).
:::
Everything in the video, ready to copy:
# Non-parametric tests - no normality assumption # Mann-Whitney / Wilcoxon: two independent groups wilcox.test(mpg ~ am, data = mtcars) # Kruskal-Wallis: three or more groups kruskal.test(Sepal.Length ~ Species, data = iris) # Wilcoxon signed-rank: paired data with(sleep, wilcox.test(extra[group == 1], extra[group == 2], paired = TRUE))
Download this R script · ▶ Practice in the playground
When to use it. Reach for these when normality is doubtful or the sample is small: Mann-Whitney (2 independent groups), Kruskal-Wallis (3+ groups), Wilcoxon signed-rank (paired).
Read parametric vs non-parametric · checking normality.
Next: Effect Size: Cohen’s d & Hedges’ g →