← Course home
MODULE 12 · FIRST-YEAR LEVEL

Non-parametric tests and robustness

What options exist when modelling assumptions are unsuitable?

70–90 minutesConcepts first, R optionalSynthetic data

Learning outcomes

Conceptual lesson

Non-parametric procedures may rely on fewer distributional assumptions or ranks. The Mann–Whitney/Wilcoxon rank-sum test compares independent distributions; it is not always simply a test of medians. The paired Wilcoxon signed-rank test works on within-pair differences; symmetry of differences matters for some interpretations.

Kruskal–Wallis is a rank-based option for comparing more than two independent groups. These methods do not solve every assumption problem: independence, sampling design, scale and ties still matter. Switching tests only because the first result was not significant is outcome-dependent selection.

Choose an estimand and method based on the research question. Sensitivity analyses compare reasonable alternative methods; keep them separate from the prespecified primary analysis.

Worked research example

For fictional `score_pre` and `score_post`, keep the participant pairing in `wilcox.test(..., paired=TRUE)`. A rank test result cannot establish why scores differ.

Common reasoning trap

“Non-parametric” does not mean “assumption free”.

Independent practice

  1. Choose rank-based tests for an independent two-group comparison and a paired comparison.
  2. Name two design or distributional considerations for rank tests.
  3. Explain how you would report different t-test and Wilcoxon conclusions transparently.

Explain your reasoning, not only the number.

Optional R lab

Save the synthetic CSV in the working folder before running the script. Base R only.

CSV · Download R script

# Statistics Lab / ferdo — synthetic data (no real student records)
# Save stats_synthetic.csv in your working directory.
d <- read.csv("stats_synthetic.csv", stringsAsFactors = TRUE)
stopifnot(nrow(d) == 36, all(c("score_pre","score_post","group") %in% names(d)))
# Groups are observational labels: differences cannot establish a treatment effect.

wilcox.test(d$score_post, d$score_pre,
            paired=TRUE, exact=FALSE)
ab <- subset(d, group %in% c("A","B"))
wilcox.test(score_post ~ group, data=ab, exact=FALSE)
kruskal.test(score_post ~ group, data=d)

Stretch: mathematical track

Discuss the exchangeability condition needed for a valid permutation test.

Exit ticket

Write one defensible claim and one limitation from this week's example.

Student workbook and self-check

Four first-year written problems, 20-mark rubric and a four-question self-check.

Open week 12 workbook →