The Shapiro–Wilk normality test: how to use it and its pitfalls
The Shapiro–Wilk test is the most widely used test of whether data depart from a normal distribution, and it is often run to check the assumptions of t tests and ANOVA. But reading “P > 0.05” as “normal”, or switching tests on its result alone, can mislead. This guide shows with numbers how its behavior changes with n, and how to use it together with a Q-Q plot.
What the Shapiro–Wilk test tells you
- The null hypothesis is that the data come from a normal distribution; a small P is evidence of non-normality
- A large P does not prove normality (only that evidence against it is lacking)
- With small n it misses real departures; with large n it flags tiny, harmless ones
- Check the shape by eye with a Q-Q plot or dot plot, and ideally choose your test in advance
The statistic W measures how well the sorted data match the ordering expected under a normal distribution; it runs from 0 to 1, with values near 1 looking normal and smaller values departing from it.
With small n, even skewed data pass
We tested data that copy the shape of a strongly right-skewed (log-normal) distribution exactly (its theoretical quantiles), at different n. The shape is the same in every row.
| n | W | P |
|---|---|---|
| 5 | 0.912 | 0.48 |
| 8 | 0.878 | 0.18 |
| 10 | 0.864 | 0.084 |
| 15 | 0.841 | 0.013 |
| 20 | 0.826 | 0.0022 |
Up to n = 10, P > 0.05, which reads as “normality is fine”. In typical bench experiments with 3 to 8 per group, the Shapiro–Wilk test can hardly be expected to detect skew.
With large n, trivial departures become significant
Conversely, here is the same exercise with the logistic distribution, which looks almost normal but has slightly heavier tails.
| n | W | P |
|---|---|---|
| 20 | 0.9995 | 1.00 |
| 100 | 0.9961 | 0.99 |
| 500 | 0.9935 | 0.029 |
| 1000 | 0.9928 | 9 × 10−5 |
| 2000 | 0.9924 | 1 × 10−8 |
At n = 100, P = 0.99 is nowhere near significant, but the test becomes significant at n = 500 (P = 0.029) and n = 1000 (P = 9 × 10−5). Yet with large n, t tests and ANOVA are barely affected by such departures thanks to the central limit theorem. “Significant, so no t test” does not follow.
Check by eye with a Q-Q plot
A Q-Q plot draws the sorted data (y) against where they would fall under a normal distribution (x). Points close to a straight line mean near-normal; a bow means skew; departures only at the ends mean heavy tails.
As on the right, the shape can be clearly skewed even when the test is not significant. Especially with small n, the dot plot, the Q-Q plot and what this kind of measurement has looked like in the past are more reliable than the test’s P value.
Using it when choosing a test
The two-stage rule “nonparametric if Shapiro–Wilk P < 0.05, otherwise t test” is common but not recommended:
- As shown above, it misses skew with small n and switches for harmless departures with large n
- Choosing the main test from a preliminary test makes the overall type I error rate differ from the nominal one
- Repeating the same experiment can lead to a different test each time
Instead, decide the test before the experiment from the nature of the measurement (concentrations and ratios tend to be right-skewed and become near-normal on a log scale), past data and dot plots, and report Shapiro–Wilk as a check that the chosen test’s assumptions are not badly violated. The overall flow is in choosing a statistical test.
How to write it in a paper
Methods: “Normality was assessed with the Shapiro–Wilk test and equality of variances with the Brown–Forsythe test.” If you report the result, write “no marked departure from normality was detected in any group (Shapiro–Wilk, all P > 0.05)” rather than “the data were normally distributed”. If you log-transformed, say that the test was run on the transformed values.
FAQ
If P > 0.05, can I write that the data were normally distributed?
Better not. The test only shows that there is not enough evidence of non-normality. Write something like “no marked departure from normality was detected (Shapiro–Wilk test).”
Which values should I test?
For two-group t tests and ANOVA, test each group (or the pooled residuals, each value minus its group mean); for a paired t test, test the paired differences. The assumptions are about these, not the raw data as a whole. BenchFig tests each group, or the differences when two groups are paired.
Shapiro–Wilk or Kolmogorov–Smirnov?
When the mean and SD are estimated from the data, Shapiro–Wilk is generally more powerful than the Kolmogorov–Smirnov test with the Lilliefors correction. Plugging estimated mean and SD into an uncorrected Kolmogorov–Smirnov test is incorrect.
What should I do if the data are not normal?
Right-skewed data such as concentrations or ratios often become close to normal on a log scale. If not, use nonparametric tests such as Mann–Whitney or Kruskal–Wallis. Ideally decide this before the experiment.
Related guides
Product and journal names are trademarks or registered trademarks of their respective owners.