Distribution Testing

Testing for Normality

Shapiro-Wilk test

Razali, N. and Wah, Y. (2011) Power Comparisons of Shapiro-Wilk, Kolmogorov-Smirnov, Lilliefors and Anderson-Darling tests. Journal of Statistical Modeling and Analytics, 2, 21-33.

Mathematical Formulation

W=(i=1nαiy(i))2i=1n(y(i)yˉ)2\begin{equation*} W = \frac{(\sum_{i=1}^n \alpha_i y_{(i)})^2}{\sum_{i=1}^n (y_{(i)} - \bar{y})^2} \end{equation*}
  • y(i)y_{(i)} is the ii the order statistics

  • α\alpha vector is calculated as mTV1(mTV1V1m)1/2\frac{m^TV^{-1}}{(m^T V^{-1} V^{-1} m)^{1/2}}

  • mm is the expected values of the order statistics

  • VV is the covariance matrix of the order statistics

Note

  • Has a bias by sample size. The larger the sample, the morel likely to get a statistically significant result. AS R94 version of the test can be used for nn in the range of 3 to 5000

  • Shapiro-Wilk generally has better power for a given significance

Last updated