Sub topic 12
When Assumptions Fail: Non-Parametric Tests
Assume you already know the DMAIC cycle, descriptive statistics, histograms, box plots, and the difference between a sample and a population. This chapter focuses on choosing a test when normality or other assumptions for a parametric test are not credible.
Parametric tests compare numerical parameters such as means. They work well when their assumptions are reasonable. Non-parametric tests use ranks or counts instead of relying as strongly on a particular probability distribution. They are useful for skewed data, outliers, ordinal ratings, or small samples.
A non-parametric test is not assumption-free. The observations should still be independent unless the test is designed for paired data. The sampling process should represent the process being studied.
Choose the test by study design
First identify how the observations were collected. The choice depends on the number of groups and whether observations are independent or paired.
| Process question | Non-parametric test | Typical parametric counterpart |
|---|---|---|
| Are two independent groups different? | Mann-Whitney U | Two-sample t-test |
| Did paired measurements change? | Wilcoxon signed-rank | Paired t-test |
| Are three or more independent groups different? | Kruskal-Wallis | One-way ANOVA |
The Mann-Whitney U test compares the ranks of two independent groups. For example, you might compare cycle times from Line A and Line B when the cycle times are strongly right-skewed. It is often described as a test of medians, but that interpretation is safest when the groups have similarly shaped distributions.
The Wilcoxon signed-rank test uses the differences within matched pairs. Use it when the same machine, operator, or unit is measured before and after a change. It tests whether the typical paired difference is zero.
The Kruskal-Wallis test compares ranks across three or more independent groups. It tells you that at least one group differs, but not which groups differ. Use planned pairwise tests after a significant result, with an adjustment for multiple comparisons.
Understand what the result means
Rank tests replace measurements with their order. A large value receives a high rank, and a small value receives a low rank. This reduces the influence of extreme observations, but it also removes some numerical information.
The p-value answers a narrow question: assuming the null hypothesis and the test conditions are true, how unusual are results at least this different? Compare it with a significance level chosen before analysis, such as 0.05. A small p-value is evidence against the null hypothesis. It is not the probability that the null hypothesis is true.
Run the test in a way that matches the design:
import numpy as np
from scipy import stats
line_a = np.array([12.1, 11.8, 12.4, 30.0, 12.0])
line_b = np.array([13.0, 13.2, 12.8, 13.1, 13.4])
u_stat, p_value = stats.mannwhitneyu(
line_a, line_b, alternative="two-sided"
)
print("Mann-Whitney U =", u_stat)
print("p-value =", p_value)The value 30.0 is an extreme observation in Line A. A rank test limits its effect, but you should still investigate whether it represents a real process condition, a measurement error, or a special cause.
Common errors
- Using Mann-Whitney for paired before-and-after data.
- Treating a significant Kruskal-Wallis result as proof that every group differs.
- Ignoring dependence caused by repeated measurements from the same unit.
- Reporting only a p-value without the group medians, spread, sample sizes, and practical impact.
- Assuming a rank test solves problems caused by biased sampling or poor measurement.
Exercise
You compare defect-resolution times for three independent support teams. The data are heavily skewed, and a Kruskal-Wallis test gives p = 0.01. What can you conclude?
Show answer
The teams do not all have the same distribution of resolution times. You cannot identify which teams differ without adjusted pairwise comparisons. Report the group summaries and assess whether the observed differences matter operationally.