Could someone please explain how to perform a Shapiro–Wilk test using an array of values (e.g. (1,2,3,4,5)? I've been searching on Google, but almost all of the results show how to calculate this using R or SPSS. Wikipedia's information on the topic is a little cryptic for me, so I was hoping someone break it down in an easier to digest form.
-
1The German Wikipedia article goes into more detail, though you may prefer a machine translation. Essentially you test whether the data's standardised ordered values are "close" to those expected from a Gaussian distribution, with "close" being based on a weighted sum of squares. Which part do you find dificult to understand? – Henry Jan 02 '14 at 22:35
1 Answers
Conceptually, the Shapiro-Wilk test examines the closeness between the data samples after they have been ordered and standardised (i.e. transformed to a zero mean, unity variance dataset) and what the samples would have been were they drawn from a standard Normal distribution and ordered.
The ordered samples drawn from the standard Normal distribution would be monotonically increasing quantiles (inverse Cumulative Density Function (CDF)) of the standard Normal distribution. This metric of closeness (which is the Shapiro-Wilk test statistic W) is basically a square of the correlation between the ordered and standardised dataset and the inverse CDF values. The test statistic is thus a positive value with an upper bound of unity - the higher this value, the more Normal/Gaussian the data.
At the risk of a bit of self-promotion, I describe step by step on how the Shapiro-Wilk test is carried out in my blog post at link:-
http://scistatcalc.blogspot.co.uk/2013/10/shapiro-wilk-test-testing-for-normality.html
In addition, I have implemented an online javascript based Shapiro-Wilk Test Calculator in the following blog post:-
http://scistatcalc.blogspot.co.uk/2013/10/shapiro-wilk-test-calculator.html
I hope these links are of use.
- 11,609
-
Your links might be of more use if, in posting an Answer, more was given in the way of explanation (as the Question seems to me to require). – hardmath Jan 26 '14 at 21:04
-
Thank you for your feedback. I have added a paragraph at the start of the answer by way of explanation - this paragraph also occurs in the blog post in the first link (the second paragraph). – Alijah Ahmed Jan 26 '14 at 22:08