What Is a Nonparametric Test and When Should You Use It?
If your data does not follow a normal distribution—or you are working with ranks, scores, or ordinal categories—standard t-tests and ANOVA may give misleading results. A nonparametric test offers a robust alternative that does not assume a specific underlying distribution. This article explains what nonparametric tests are, how the most common ones work, and how to apply them correctly.
What It Is
A nonparametric test is a statistical method that makes no assumption about the shape of the population distribution. Instead of comparing means, it typically compares medians or locations using the ranks of the data rather than the raw values.
The three most widely used nonparametric tests are:
These methods are traceable to the authoritative work of Hollander & Wolfe on nonparametric statistical methods.
How It Works
All three tests follow the same basic principle: convert raw data into ranks, then perform calculations on those ranks.
### 1. Mann-Whitney U Test (Two Independent Samples)
Steps:
\[
U_1 = n_1 n_2 + \frac{n_1(n_1+1)}{2} - R_1
\]
\[
U_2 = n_1 n_2 + \frac{n_2(n_2+1)}{2} - R_2
\]
where \( n_1 \) and \( n_2 \) are the sample sizes.
Hypotheses:
### 2. Wilcoxon Signed-Rank Test (Paired Samples)
Steps:
Hypotheses:
### 3. Kruskal-Wallis Test (Three or More Independent Groups)
Steps:
\[
H = \frac{12}{N(N+1)} \sum_{j=1}^{k} \frac{R_j^2}{n_j} - 3(N+1)
\]
where \( k \) = number of groups, \( n_j \) = sample size of group \( j \), and \( N \) = total sample size.
Hypotheses:
A Worked Illustrative Example
Example data (illustrative only): A quality engineer measures the hardness (HB) of two coating processes, A and B, with 5 samples each.
Process A | Process B
Step 1 – Combine and rank all 10 values:
Value | Group | Rank
Step 2 – Sum ranks:
Step 3 – Calculate U:
\[
U_A = (5)(5) + \frac{5(6)}{2} - 36 = 25 + 15 - 36 = 4
\]
\[
U_B = (5)(5) + \frac{5(6)}{2} - 19 = 25 + 15 - 19 = 21
\]
The smaller U is 4. For \( n_1 = n_2 = 5 \), the critical value at α = 0.05 (two-tailed) is 2. Since 4 > 2, we fail to reject H₀. There is insufficient evidence to claim a difference in median hardness between the two processes.
Common Pitfalls
---
Ready to run a nonparametric test without manual calculations? Use the free tool at 6SQ Nonparametric Test Calculator to get instant results with correct rank-based methods.
What It Is
A nonparametric test is a statistical method that makes no assumption about the shape of the population distribution. Instead of comparing means, it typically compares medians or locations using the ranks of the data rather than the raw values.
The three most widely used nonparametric tests are:
- Mann-Whitney U test – compares two independent groups (equivalent to the two-sample t-test).
- Wilcoxon signed-rank test – compares paired or matched observations (equivalent to the paired t-test).
- Kruskal-Wallis test – compares three or more independent groups (equivalent to one-way ANOVA).
These methods are traceable to the authoritative work of Hollander & Wolfe on nonparametric statistical methods.
How It Works
All three tests follow the same basic principle: convert raw data into ranks, then perform calculations on those ranks.
### 1. Mann-Whitney U Test (Two Independent Samples)
Steps:
- Combine all observations from both groups.
- Rank all values from lowest (1) to highest (N). Assign average ranks for ties.
- Sum the ranks for each group: \( R_1 \) and \( R_2 \).
- Calculate the U statistic:
\[
U_1 = n_1 n_2 + \frac{n_1(n_1+1)}{2} - R_1
\]
\[
U_2 = n_1 n_2 + \frac{n_2(n_2+1)}{2} - R_2
\]
where \( n_1 \) and \( n_2 \) are the sample sizes.
- Use the smaller of \( U_1 \) and \( U_2 \) to compare against critical values (or compute a p-value).
Hypotheses:
- H₀: The two populations have the same location (median).
- H₁: The locations differ.
### 2. Wilcoxon Signed-Rank Test (Paired Samples)
Steps:
- Compute the difference for each pair: \( d_i = x_i - y_i \).
- Remove pairs where \( d_i = 0 \).
- Rank the absolute differences \( |d_i| \) from smallest to largest.
- Assign the sign of the original difference to each rank.
- Sum the positive ranks (\( W^+ \)) and negative ranks (\( W^- \)).
- The test statistic is the smaller of \( W^+ \) and \( W^- \).
Hypotheses:
- H₀: The median difference is zero.
- H₁: The median difference is not zero.
### 3. Kruskal-Wallis Test (Three or More Independent Groups)
Steps:
- Combine all observations from all groups.
- Rank all values from 1 to N.
- Sum the ranks for each group: \( R_j \).
- Calculate the H statistic:
\[
H = \frac{12}{N(N+1)} \sum_{j=1}^{k} \frac{R_j^2}{n_j} - 3(N+1)
\]
where \( k \) = number of groups, \( n_j \) = sample size of group \( j \), and \( N \) = total sample size.
- Compare H to a chi-square distribution with \( k-1 \) degrees of freedom.
Hypotheses:
- H₀: All groups have the same location.
- H₁: At least one group differs.
A Worked Illustrative Example
Example data (illustrative only): A quality engineer measures the hardness (HB) of two coating processes, A and B, with 5 samples each.
Process A | Process B
- 52 | 48
- 55 | 51
- 49 | 47
- 58 | 53
- 54 | 50
Step 1 – Combine and rank all 10 values:
Value | Group | Rank
- 47 | B | 1
- 48 | B | 2
- 49 | A | 3
- 50 | B | 4
- 51 | B | 5
- 52 | A | 6
- 53 | B | 7
- 54 | A | 8
- 55 | A | 9
- 58 | A | 10
Step 2 – Sum ranks:
- \( R_A = 3 + 6 + 8 + 9 + 10 = 36 \)
- \( R_B = 1 + 2 + 4 + 5 + 7 = 19 \)
Step 3 – Calculate U:
\[
U_A = (5)(5) + \frac{5(6)}{2} - 36 = 25 + 15 - 36 = 4
\]
\[
U_B = (5)(5) + \frac{5(6)}{2} - 19 = 25 + 15 - 19 = 21
\]
The smaller U is 4. For \( n_1 = n_2 = 5 \), the critical value at α = 0.05 (two-tailed) is 2. Since 4 > 2, we fail to reject H₀. There is insufficient evidence to claim a difference in median hardness between the two processes.
Common Pitfalls
- Using nonparametric tests when assumptions of parametric tests are met: This reduces statistical power. Reserve them for non-normal data or ordinal scales.
- Ignoring ties: Ties require average ranks. Failing to handle them can distort results.
- Interpreting results as mean differences: These tests compare medians or locations, not means.
- Applying the wrong test: Use Mann-Whitney for independent groups, Wilcoxon for paired data, and Kruskal-Wallis for multiple groups.
---
Ready to run a nonparametric test without manual calculations? Use the free tool at 6SQ Nonparametric Test Calculator to get instant results with correct rank-based methods.
No related results found
Invited:
6SQ Tools
0 replies