# How does the Shapiro-Wilk test for normality work?

Can someone explain to me the mechanics of the Shapiro-Wilk test for normality?

I have that: $$W = \frac{ \sum (x_{(j)}-\bar{x})(m_{(j)}-\bar{m})}{\sum (x_{j}-\bar{x})^{2} \sum m_{j}^2}\,\,,$$ where $m_{j}$ is the expected value of the $j$th order statistic from $N(0,1)$.

So, what is $x_{j}$ here? Is the $m_{j}$ from a theoretical distribution, or from an observed sample? What is the test statistic comparing?

• Note it's "Shapiro-Wilk test" - there's confusion between the two statisticians Samuel S. Wilks and Martin Wilk, but it was the latter involved in the Shapiro-Wilk test. (No doubt the confusion is increased by the English use of possessive "'s"). – Silverfish Oct 2 '15 at 22:37

It's basically a sample correlation between empirical quatile and quantile from the normal distribution. So, if the true distribution is normal, we can expect that the correlation would be high.

• So .... let me check check and see if my interpretation is correct..... The "Shapiro Wilk" test is basically the measure of correlation for the Q-Q plot? – LotsofQuestions Oct 5 '15 at 15:08
• It's similar to it, but isn't actually that correlation. The Shapiro-Francia test is effectively that sort of correlation. – Glen_b Oct 26 '18 at 22:36