Shapiro-Wilk Test
Tests whether a sample comes from a normally distributed population.
Description
The Shapiro-Wilk test is one of the most powerful normality tests, especially for small samples (n = 3–50). It compares the ordered sample values with the expected values from a normal distribution. The test statistic W ranges from 0 to 1 — values close to 1 indicate normality. If p < α (e.g. 0.05), the null hypothesis of normality is rejected.
Formulas
Assumptions
- Data are independent and identically distributed (i.i.d.)
- Sample size: 3 ≤ n ≤ 5000 (optimal for n ≤ 50)
- Continuous data
Limitations
- For large samples (n > 5000), even small deviations from normality can become significant
- Not suitable for discrete data or data with many ties
- The p-value approximation can be inaccurate for very small n (n < 7)
References
- Shapiro, S. S. & Wilk, M. B. (1965), An analysis of variance test for normality (complete samples), Biometrika, 52(3–4), 591–611
- Royston, P. (1992), Approximating the Shapiro-Wilk W-test for non-normality, Statistics and Computing, 2, 117–119
- NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.5.7