Course contentsShow
← Data Science
Lesson 473 of 2,14512. ANOVA and Multiple ComparisonsFree lesson

Post-Hoc Tests After Kruskal-Wallis: Dunn's Test

Apply Dunn's test with multiple comparison corrections to identify which groups differ after a significant Kruskal-Wallis result.

Post-Hoc Tests After Kruskal-Wallis: Dunn's Test

You'll learn how to pinpoint which groups actually differ after getting a significant Kruskal-Wallis result.

Why You Need Dunn's Test

When Kruskal-Wallis tells you "at least one group differs," it's like a smoke detector going off—you know there's a problem, but not where. Just as Tukey's HSD follows ANOVA, Dunn's test follows Kruskal-Wallis to identify which specific group pairs are significantly different.

How Dunn's Test Works

Dunn's test performs pairwise comparisons between all groups using the same rank-based approach as Kruskal-Wallis. For each pair of groups, it:

  1. Calculates a Z-statistic based on the mean ranks
  2. Accounts for the overall sample size and tied ranks
  3. Adjusts p-values for multiple comparisons

The key insight: Because you're making multiple comparisons (if you have 4 groups, that's 6 pairwise tests!), you must apply corrections like Bonferroni or Holm-Bonferroni to control the family-wise error rate. Without correction, you'd have a high chance of false positives.

When to Apply Dunn's Test

  • Your Kruskal-Wallis test was significant (p < 0.05)
  • You want to know which groups differ from each other
  • Your data still violates parametric assumptions (if assumptions are met after ANOVA, you'd use parametric post-hoc tests instead)

Think of it this way: Dunn's test is your magnifying glass after Kruskal-Wallis rang the alarm bell—it lets you zoom in on the specific differences while protecting you from false discoveries through correction methods you already know.

Key Takeaway: Dunn's test identifies which specific group pairs differ after a significant Kruskal-Wallis result, using pairwise rank comparisons with multiple comparison corrections (like Bonferroni) to maintain statistical validity.