Non-Parametric Tests
Learn distribution-free statistical tests for when parametric assumptions fail. Master Mann-Whitney, Wilcoxon, and Kruskal-Wallis tests.
On This Page
What Are Non-Parametric Tests?
Non-parametric tests (distribution-free tests) don’t assume the data follows a specific distribution like normal.
| Parametric Test | Non-Parametric Alternative |
|---|---|
| One-sample t-test | Wilcoxon signed-rank |
| Independent t-test | Mann-Whitney U |
| Paired t-test | Wilcoxon signed-rank (paired) |
| One-way ANOVA | Kruskal-Wallis |
| Pearson correlation | Spearman correlation |
When to Use Non-Parametric Tests
Advantages
- No distribution assumptions
- Work with ordinal data
- Robust to outliers
- Valid for small samples
Disadvantages
- Less statistical power than parametric tests
- Harder to generalize
- Results may be harder to interpret
1. Mann-Whitney U Test
Alternative to the independent two-sample t-test. Tests if two groups come from the same population.
H₀: The two populations are identical H₁: The populations differ in location (one tends to have larger values)
Based on ranks of combined data.
Compare treatment A vs B effectiveness (small samples):
| Treatment A | Treatment B |
|---|---|
| 5 | 9 |
| 7 | 12 |
| 8 | 15 |
| 6 | 10 |
Step 1: Rank all data combined
| Value | Treatment | Rank |
|---|---|---|
| 5 | A | 1 |
| 6 | A | 2 |
| 7 | A | 3 |
| 8 | A | 4 |
| 9 | B | 5 |
| 10 | B | 6 |
| 12 | B | 7 |
| 15 | B | 8 |
Step 2: Sum ranks for each group
- Sum A = 1+2+3+4 = 10
- Sum B = 5+6+7+8 = 26
Step 3: Calculate U U₁ = n₁n₂ + n₁(n₁+1)/2 - R₁ = 4×4 + 4×5/2 - 10 = 16 + 10 - 10 = 16 U₂ = n₁n₂ + n₂(n₂+1)/2 - R₂ = 4×4 + 4×5/2 - 26 = 16 + 10 - 26 = 0
U = min(U₁, U₂) = 0
Step 4: Compare to critical value or p-value For n₁=n₂=4, α=0.05 (two-tailed), critical U = 1
Since U = 0 ≤ 1, reject H₀.
Treatment B produces significantly larger values.
2. Wilcoxon Signed-Rank Test
Alternative to paired t-test. Tests if the median difference is zero.
H₀: Median difference = 0 H₁: Median difference ≠ 0
Based on ranks of absolute differences.
Before/after blood pressure measurements:
| Subject | Before | After | Diff | Abs Diff | Rank | Signed Rank |
|---|---|---|---|---|---|---|
| 1 | 150 | 145 | -5 | 5 | 1 | -1 |
| 2 | 155 | 148 | -7 | 7 | 2.5 | -2.5 |
| 3 | 148 | 151 | +3 | 3 | — | (exclude) |
| 4 | 160 | 150 | -10 | 10 | 4 | -4 |
| 5 | 158 | 151 | -7 | 7 | 2.5 | -2.5 |
Note: Exclude differences of 0 and average tied ranks.
Sum positive ranks: W+ = 0 Sum negative ranks: W- = 1 + 2.5 + 4 + 2.5 = 10
W = min(W+, W-) = 0
Compare to critical value. Small W indicates significant difference.
Conclusion: Treatment significantly reduced blood pressure.
3. Kruskal-Wallis Test
Alternative to one-way ANOVA. Compares three or more independent groups.
H₀: All populations have the same distribution H₁: At least one population differs
Where:
- N = total sample size
- k = number of groups
- Rᵢ = sum of ranks in group i
- nᵢ = size of group i
If H is significant, use post-hoc tests (like Dunn’s test) to find which groups differ.
Three pain medications rated on 1-10 scale:
| Drug A | Drug B | Drug C |
|---|---|---|
| 3 | 6 | 8 |
| 4 | 5 | 9 |
| 2 | 7 | 7 |
Rank all 9 values: Combined: 2, 3, 4, 5, 6, 7, 7, 8, 9
Sum of ranks:
- Drug A: ranks 1+2+3 = 6
- Drug B: ranks 4+5+6.5 = 15.5
- Drug C: ranks 6.5+8+9 = 23.5
Calculate H: N = 9, k = 3, n₁ = n₂ = n₃ = 3
H = [12/(9×10)] × [6²/3 + 15.5²/3 + 23.5²/3] - 3(10) = 0.133 × [12 + 80.1 + 184.1] - 30 = 0.133 × 276.2 - 30 = 36.7 - 30 = 6.7
Compare to chi-square distribution (df = k-1 = 2) Critical χ²₀.₀₅(2) = 5.99
Since H = 6.7 > 5.99, reject H₀.
At least one drug differs in effectiveness.
4. Spearman Rank Correlation
Non-parametric alternative to Pearson correlation. Measures monotonic relationship.
Where dᵢ = difference in ranks for observation i
Use when:
- Data is ordinal
- Relationship is monotonic but not linear
- Outliers present
Choosing the Right Test
| Research Question | Parametric | Non-Parametric |
|---|---|---|
| One sample vs value | t-test | Wilcoxon signed-rank |
| Two independent groups | t-test | Mann-Whitney U |
| Two paired measurements | Paired t | Wilcoxon signed-rank |
| 3+ independent groups | ANOVA | Kruskal-Wallis |
| Linear relationship | Pearson r | Spearman rₛ |
Handling Ties
When values are tied (equal), assign the average rank to all tied values.
Values: 5, 7, 7, 7, 10
Rankings: 1, (2+3+4)/3, (2+3+4)/3, (2+3+4)/3, 5
= 1, 3, 3, 3, 5
The three 7s each get rank 3 (the average of ranks 2, 3, 4).
Summary
In this lesson, you learned:
- Non-parametric tests don’t require distributional assumptions
- Mann-Whitney U: Compares two independent groups (t-test alternative)
- Wilcoxon signed-rank: Compares paired observations (paired t alternative)
- Kruskal-Wallis: Compares 3+ groups (ANOVA alternative)
- Spearman correlation: Non-parametric correlation
- Based on ranks rather than actual values
- Use when assumptions fail or data is ordinal
Practice Problems
1. When would you choose Mann-Whitney U over an independent t-test?
2. Group A scores: 12, 15, 18 Group B scores: 22, 25, 28 Calculate the sum of ranks for each group.
3. Five subjects have before/after differences: -3, +5, -2, -4, -1 Calculate W+ and W- for the Wilcoxon signed-rank test.
4. A Kruskal-Wallis test yields H = 8.5 with 3 groups (df=2). Critical χ² = 5.99 at α = 0.05. What’s the conclusion?
Click to see answers
1. Use Mann-Whitney when:
- Sample sizes are small (< 30)
- Data is not normally distributed
- Data is ordinal (rankings, scales)
- Outliers are present
- Variances are very unequal
2. Combined and ranked: 12(1), 15(2), 18(3), 22(4), 25(5), 28(6)
- Group A sum: 1 + 2 + 3 = 6
- Group B sum: 4 + 5 + 6 = 15
3. Absolute differences and ranks:
- |-3| = 3 → rank 3 (negative)
- |+5| = 5 → rank 5 (positive)
- |-2| = 2 → rank 2 (negative)
- |-4| = 4 → rank 4 (negative)
- |-1| = 1 → rank 1 (negative)
W+ = 5 (only the +5) W- = 1 + 2 + 3 + 4 = 10
4. H = 8.5 > 5.99 (critical value) Reject H₀. There is significant evidence that at least one group differs from the others.
Next Steps
Continue with advanced statistics:
- Effect Size and Power - Beyond p-values
- Bayesian Statistics Introduction - Alternative framework
- T-Test Calculator - Practice calculations
Was this lesson helpful?
Help us improve by sharing your feedback or spreading the word.