Shapiro-Wilk Test

Tests whether a sample comes from a normally distributed population.

Statusvalidated
Version1.0.0
Minitab equivalentStat > Basic Statistics > Normality Test (Shapiro-Wilk)

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

W
Test statistic W: ratio of the weighted sum of ordered values to the total sum of squares
a
Weight vector a, computed from the expected normal order statistics m and the covariance matrix V
H₀
Null hypothesis: The sample comes from a normal distribution

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