# Shapiro-Wilk Original Test

We present the original approach to the performing the Shapiro-Wilk Test. This approach is limited to samples between 3 and 50 elements. By clicking here you can also review a revised approach using the algorithm of J. P. Royston which can handle samples with up to 5,000 (or even more).

The basic approach used in the Shapiro-Wilk (SW) test for normality is as follows:

• Rearrange the data in ascending order so that x1 ≤ … ≤ xn.
• Calculate SS as follows:

• If n is even, let m =  n/2, while if n is odd let m = (n–1)/2
• Calculate b as follows, taking the ai weights from the Table 1 (based on the value of n) in the Shapiro-Wilk Tables. Note that if n is odd, the median data value is not used in the calculation of b.

• Calculate the test statistic W = b2 ⁄ SS
• Find the value in the Table 2 of the Shapiro-Wilk Tables (for a given value of n) that is closest to W, interpolating if necessary. This is the p-value for the test.

For example, suppose W = .975 and n = 10. Based on Table 2 of the Shapiro-Wilk Tables the p-value for the test is somewhere between .90 (W = .972) and .95 (W = .978).

Example 1: A random sample of 12 people is taken from a large population. The ages of the people in the sample are given in column A of the worksheet in Figure 1. Is this data normally distributed?

Figure 1 – Shapiro-Wilk test for Example 1

We begin by sorting the data in column A using Data > Sort & Filter|Sort or the QSORT supplemental function, putting the results in column B. We next look up the coefficient values for n = 12 (the sample size) in Table 1 of the Shapiro-Wilk Tables, putting these values in column E.

Corresponding to each of these 6 coefficients a1,…,a6, we calculate the values x12 – x1, …, x7 – x6, where xi is the ith data element in sorted order. E.g. since x1 = 35 and x12 = 86, we place the difference 86 – 35 = 51 in cell H5 (the same row as the cell containing a1). Column I contains the product of the coefficients and difference values. E.g. cell I5 contains the formula =E5*H5. The sum of these values is b = 44.1641, which is found in cell I11 (and again in cell E14).

We next calculate SS as DEVSQ(B4:B15) = 2008.667. Thus W = b2SS = 44.1641^2/2008.667 = .971026. We now look for .971026 when n = 12 in Table 2 of the Shapiro-Wilk Tables and find that the p-value lies between .50 and .90. The W value for .5 is .943 and the W value for .9 is .973.

Interpolating .971026 between these value (using linear interpolation), we arrive at p-value = .873681. Since p-value = .87 > .05 = α, we retain the null hypothesis that the data are normally distributed.

Example 2: Using the SW test, determine whether the data in Example 1 of Graphical Tests for Normality and Symmetry are normally distributed.

Figure 2 – Shapiro-Wilk test for Example 2

As we can see from the analysis in Figure 2, p-value = .0419 < .05 = α, and so we reject the null hypothesis and conclude with 95% confidence that  that the data are not normally distributed, which is quite different from the results using the KS test that we found in Example 2 of Kolmogorov-Smironov Test.

Real Statistics Function: The Real Statistics Resource Pack contains the following supplemental functions where R1 consists only of numeric data without headings:

SHAPIRO(R1, FALSE) = the Shapiro-Wilk test statistic W for the data in the range R1

SWTEST(R1, FALSE, h) = p-value of the Shapiro-Wilk test on the data in R1

SWCoeff(n, j, FALSE) = the jth coefficient for samples of size n

SWCoeff(R1, C1, FALSE) = the coefficient corresponding to cell C1 within sorted range R1

SWPROB(n, W, FALSE, h) = p-value of the Shapiro-Wilk test for a sample of size n for test statistic W

The functions SHAPIRO and SWTEST ignore all empty and non-numeric cells. The range R1 in SWCoeff(R1, C1, FALSE) should not contain any empty or non-numeric cells.

When performing the table lookup, the default is to use harmonic interpolation (h = TRUE). To use linear interpolation, set h to FALSE. See Interpolation for details.

For example, for Example 1 of Chi-square Test for Normality, we have SHAPIRO(A4:A15, FALSE) = .874 and SWTEST(A4:A15, FALSE, FALSE) = SWPROB(15,.874,FALSE,FALSE) = .0419 (referring to the worksheet in Figure 2 of Chi-square Test for Normality).

It is important to note that SHAPIRO(R1, TRUE), SWTEST(R1, TRUE), SWCoeff(n, j, TRUE), SWCoeff(R1, C1, TRUE) and SWPROB(n, W, TRUE) refer to the results using the Royston algorithm, as described in Shapiro-Wilk Expanded Test.

For compatibility with the Royston version of SWCoeff, when j ≤ n/2 then SWCoeff(n, j, False) = the negative of the value of the jth coefficient for samples of size n found in the Shapiro-Wilk Tables. When j = (n+1)/2, SWCoeff(n, j, FALSE) = 0 and when  j > (n+1)/2, SWCoeff(n, j, FALSE) = -SWCoeff(n, n–j+1, FALSE).

### 78 Responses to Shapiro-Wilk Original Test

1. javiera says:

I have a question, pretty elemental, but I need an answer. In example number 1 I’m following you until the interpolation, how did you do that? I mean, table number 2 doesn’t follow a lineal function, so i tried to put it into a logaritmic function and it didn’t work.

Thank you.

Hi Javiera,
It is a good question. I simply used a linear interpolation. As you pointed out, the table doesn’t represent a linear function, but the results will usually be good enough. I will probably use a more sophisticated approach in the future, but for now I wanted to keep it simple.
Charles

2. Touseef says:

Thanks for the information you provided about SW test. As i am not having the statistic background so i have a small question as when the random samples increase up to n=500 suppose, how would we get the weights “a” as the table only provides “n” up to 50 only?
I would appriciate if you could provide the answer.

Hi Touseef,
I got the “a” weights from the original paper of Shapiro and Wilk in 1965. In that paper they only provided weights up to n = 50. If it is truly a random sample, then by the Central Limit Theorem for large values of n (usually n > 50 is more than sufficient), the sample will be approximately normally distributed and so doesn’t need to be tested for normality (again provided the sample is truly randomly selected).
Charles

3. Molly says:

Hi,
Thank you so much for posting this! It was really helpful and easy to understand. My only question is in question one: how do you interpolate the W values? Is there an equation you used?

Hi Molly,

Currently, I don’t do anything particularly sophisticated. I simply perform a linear interpolation for the W values. Even if the value is not precise, it is much higher than the p-value of .05, and so we cannot reject that the data is normally distributed.

Because so many people have asked for the Shapiro-Wik test for samples larger than 50, yesterday I added a new version of the SW test which doesn’t use interpolation and supports sample sizes of at least 5,000. This is available in the current version of the Real Statistics Resource Pack (R1.7.1).

Charles

4. Dmitry says:

I do not understand the answer to Touseef. The CLT says that the sampling distribution of the mean is approx. Normal for large random sample. It says nothing about the distribution of the sample values. If you are sampling from a non-Normal population, the sample distribution will not be Normal no matter how large the sample is, right?

• Charles says:

Dmitry,
The CLT says that the sample distribution will indeed be approximately normal for large enough samples even if the population distribution is not normal.
Charles

5. Louis says:

I’ve done a few tests using your RS resources pack this and I’m afraid to say I’m detecting a bug of sorts, SWTEST(R1) doesn’t always return the same as SWPROB(n,W) – the latter giving the correct result. I’m not sure if you actually checked this for different values when testing the algorithm? Really not trying to be ungrateful, it’s a brilliant add-in, but I just noticed that in “SHAPIRO(A4:A15) = .874 and SWTEST(A4:A15) = SWPROB(15,.874) = .0419” the range A4:A15 wouldn’t provide a value of 15 for n unless I’m mistaken?

Again, thanks for all your work on the site/excel package!

• Louis says:

my example data, starting with a label in A1 :
—————————-
sample1: 2.8078385
sample2: 6.22198918
sample3: 100
sample4: 58.555133
sample5: 9.0669786
sample6: 2.2813688
sample7: 0.6727113
W: =SHAPIRO(B2:B8)=0.7118325
incorrect p-value: =SWTEST(B2:B8)=0.782674
(from what I can see) correct p-value: =SWPROB(7,B32)=0.005

From what I can see in the p table for n=7, W=0.7118… lies between p=0 and p=0.01, i.e. p=0.005 is feasible but 0.782674 ain’t.

I think I’m just going to use SWPROB for now!

• Charles says:

Dear Louis,

Thanks for finding this error. There was an error in my implementation of the Royston algorithm for performing the Shapiro-Wilk test for normality for samples between 4 and 11 elements. I believe that I have now fixed this in the latest release of the Real Statistics Resource Pack which I just put on the website. If you download and install this version (release 1.7.3), you should find that SWTEST(B2:B8) = .004981. The value using the original SW algorithm is calculated by SWTEST(B2:B8,False) = .005.

Please note that the following Shapiro-Wilk functions have both Royston and original SW versions: SHAPIRO(R1,b), SWTEST(R1,b), SWCoeff(n,j,b). If b is True or is omitted then the Royston algorithm is used. If b is False then the original SW algorithm is used. The SWCoeff(n,j,False) version is new. I just added it to the software. It gives the a coefficients found in the SW Coefficient Table on webpage http://www.real-statistics.com/statistics-tables/shapiro-wilk-table/. I will be updating the website shortly to explain this new function.

Caution should be used when employing either version of the SW Test for very small samples (less than 15 or 20) since the results are not completely accurate.

Thanks again for identifying the error and sorry for any inconvenience it caused.

Charles

• Charles says:

Hello Louis,

For Example 2 on the webpage http://www.real-statistics.com/tests-normality-and-symmetry/statistical-tests-normality-symmetry/shapiro-wilk-test/, we have the following results SHAPIRO(A4:A18, False) = .874 and SWTEST(A4:A18, False) = SWPROB(15,.874) = .0419. The range used is A4:A18 and not A4:A15, and so a sample size of 15 is correct.

Please note that to use the original Shapiro-Wilk algorithm you need to specify False as the second parameter. The website was not clear about this. I have now revised the website to make this clearer. If you leave out the second parameter, you will get SHAPIRO(A4:A18) = .874 and SWTEST(A4:A18) = 0387, which are the results using the Royston algorithm. Obviously in this case there wasn’t a great difference.

Charles

6. Michael Hardy says:

Table 2 gives “the probability that the data comes from a normal distribution”??

Could it be that what Table 2 gives is the p-value? It is commonplace to be incessantly explaining to people who don’t understand math that the p-value is NOT the same as the probability of the null hypothesis. This is called “the prosecutor’s fallacy”; Google that term!

Given the null hypothesis of the defendant’s innocence, the probability of a test statistic at least as extreme as the one observed is 1 in 1000. So the prosecutor’s fallacy is the mistaken idea that that means there’s a 1 in 1000 chance of innocence. Consider: Suppose the culprit is one member of a population of 500,000. If something happens 1 time out of 1000 to each person, then there are 500 people in that population for whom the p-value is at least as extreme as what was observed. That means the defendant is one of the 500 people who could be the culprit.

• Charles says:

Michael,
You are absolutely correct. I have now made the corrections in the appropriate places on the webpage. Thanks for identifying the error.
Charles

7. Richard says:

I believe there are two minor errors in the two paragraphs following Figure 1. First, about halfway through the paragraph following Figure 1, the text states “. . . we calculate the values x12 – x11, . . . ” I believe x11 is a typo and the correct text should read “. . the values x12 – x1, . . . ”

Second, I believe there is an error in the cell range given in first sentence, of second paragraph, following Figure 1. Specifically, the text currently reads “We next calculate SS as DEVSQ(B5:B16) = . . . ” The correct cell range should be ” . . . as DEVSQ(B4:B15) = . . . ”

Thanks for the great web page! Its has been very helpful to me.

• Charles says:

Richard,
You are correct on both counts. Thanks for finding these errors. I have now updated the webpage with your corrections. I am pleased to read that you found the webpage helpful. I hope that you will continue to use the site.
Charles

8. olu says:

Hi guys,

I understand t tests can only be performed on two groups of samples with uniform distribution. What can i use if one group is uniform while the other isn’t?

• Charles says:

Olu,
The t test requires normally distributed samples (not uniform), but it is pretty forgiving and will usually work well with reasonably symmetric data. If one group is not acceptable then you should use a non-parametric test. E.g. if the two samples are independent then you can use Mann-Whitney.
Charles

9. Colin says:

Sir

SWCoeff(n, j, False) gives us a negative number. LOL. You may change it in the next version of Real Statistics, or we can just multiply -1 to fix the problem.

Colin

10. Colin says:

Sir

SWCoeff(n, j, False) gives us a negative number. LOL. You may change it in the next version of Real Statistics, or we can just multiply -1 to fix the problem. I am using the latest Real Statistics add-in.

Colin

• Charles says:

Colin,
I set SWCoeff(n,j,False) to be negative for consistency with the Royston version, namely SWCoeff(n,j,True). For j < (n+1)/2 SWCoeff(n,j,False) is negative, while for j > (n+1)/2 it is positive.
Charles

11. Colin says:

Sir

Sorry! Forgave me. I found the explanation at the end of this blog.

Colin

12. Julien says:

Hi Charles,
Thanks a lot for this web page!!

You said that the function SWTEST ignore all empty and non-numeric cells. Sure? Because if I add empty cells at the end of the range R1, the p-value is different.

Also, what is the difference between the original Shapiro-Wilk test and the Royston algorithm, and when do you one or the other? (Meaning that I don’t know if in the SWTEST I have to write “FALSE” or “TRUE”.

Thank you very much!
Julien

• Charles says:

Hi Julien,

I just retested the SWTEST and SHAPIRO functions by adding empty and non-numeric cells at the beginning, end and in the middle of the range. The results are all the same. Which version of Excel are you using?

If the values you are looking for are found in the table then you might as well use the original algorithm (although the results using the Royston algorithm are quite similar). Otherwise you should use the Royston algorithm. I tend to use the Royston algorithm always since in that case I don’t need to make any decisions.

Charles

• Julien says:

I use Microsoft Excel for Mac 2011 in English

• Charles says:

Julien,
Which version of the Real Statistics Resource Pack do you have? You can find this out by entering =VER() in any cell. If it is not one of the latest releases (Release 2.15) then this could account for the problem.
Charles

• Julien says:

Hi Charles,

It’s the release 2.10.1

• Charles says:

Julien,
This is the latest version of the software for the Mac, but it doesn’t contain some of the features that I have added for Windows. In particular WTEST only returns the one-tailed version of the test. You just need to double the value to get the p-value for the two-tailed test. I hope to get a new version for the Mac out soon (as soon as I can get a Mac computer to test it on).
Charles

• Charles says:

Julien,
Now I understand the problem. I have not yet updated the Mac version of the software with the latest features. This is why some of the arguments don’t work and why some of the functions don’t handle missing data the same way. My problem is that I don’t have a Mac myself and need to borrow one to test and update the software.
Charles

13. Shreya says:

Hi Charles,
I found this webpage is very useful and it guided me so well. Thank you very much. But I would like to know something..How will you rank this test with respect to A-D and K-S test?
Shreya

• Charles says:

Hi Shreya,
I would use SW over KS. I have not used AD and so don’t have an opinion.
Charles

14. Swanand Rishi says:

The example 1 is well explained. However, my linearly interpolated value of Wc (p-value) comes out to be 0.89999 instead of 0.876681. The interpolation coeffcient is 0.075 per probability of .1, between 0.5 and 0.9. Hence for approx. diff. of 0.002 in W (0,973-0,971), p value = 0.89999. Pl. correct me if wrong.

15. sundar says:

how is analysis durbin watson test using excel or spss software. Please tell step by step sending my email id

16. Gurumani says:

Thank you Dr. I am learning a lot from your useful website. When I tried Real Stat for Shapir0-Wilk test for the two data given in the two examples, I get different W and p values from those given in the examples, as follows:
W=b^2/SS 0.971025924 W 0.971122526
0.5 0.943 p-value 0.922200674
0.9 0.973 alpha 0.05
p-value 0.873679 normal yes

W=b^2/SS 0.873965213 W 0.874012
0.02 0.855 p-value 0.03866
0.05 0.881 alpha 0.05
p value 0.041882692 normal no
Could you please explain why the difference? Have I committed any mistake in the calculations?

• Charles says:

I don’t know why you get different results. If you send me a spreadsheet with your calculations I will try to understand why there is a difference.
Charles

I want to know what happens if data fails the SW test?
Is there any way out?

• Charles says:

Jerry,
If data is not normally distributed, then for tests that assume normality you can
1. use a nonparametric test that doesn’t require normality
2. transform the data so that the resulting data is sufficiently normal
In addition, some tests that require normality (e.g. the t test) are sufficiently robust that as long as the data is symmetric the test will usually be ok (although even in these cases, the Mann-Whitney nonparametric test should give similar results).
Charles

18. Tony O says:

I have gone through your explanation and I found very rewarding and useful. However, will appreciate an example for sample that is odd and not even like your two examples.

Regards

• Charles says:

Tony,
The sample in the second example has an odd number of elements. The middle element is not used.
Charles

19. Joana says:

Hi Charles,

Thanks for the information on the website. It is really useful. However when I applied the Shapiro test to my data it gave me an error. This error does not happen for larger samples (mine is 4) like 5 or 6. Is there a limitation to the excel function that does not allow small samples to be tested with this function?

Thanks

• Charles says:

It looks like it should work for samples of size at least 5.
Charles

• Joana says:

Hi Charles,

I tried again the Shapiro test on my data and surprisingly it work for a sample size 3 but still not 4… Just thought I should let you know.

Thanks for the website

Joana

• Charles says:

Joana,
Thanks for finding this bug.
The original test for sample size of 4 does work (setting the second argument in the SHAPIRO or SWTEST function to False). The Royston version of the test has the bug when the sample size is 4.
I will provide a fix in the next release.
Thanks again for helping me improve the accuracy of the software.
Charles

20. Soira says:

Hello Dr. Zaiontz,
I really appreciate your examples and web page on real statistics using excel. I tried Shapiro-Wilk test on my data (n=10),however, I have got many variables, so I am testing the normality for each of the variables. So for one of the data, I got W=0.5679 and I referred the Wilk Test sheet, I could not get the P-values. Could something be wrong with my data itself? Or is there an extended table? Please help.
Thanks

21. Pri says:

These are the W values I have got from a raw data of response times for n=18.
1,012157199 0,996684879 0,824085184 0,960953212 1,006536182
Most of these values of W are out of range from the (n/p)table. Does that mean I have some calculation errors? If not, then how do I interpret the data?

• Charles says:

Pri,

Since W = 0,824085184 is less than the smallest value in the table for n = 18 and p = .01, it just means that p < .01 Actually, I calculate that the p-value = 0,003394 using the Royston approximation that is described elsewhere on the website. This means that your data is likely not normally distributed. Similarly, W = 0,9609532124 is greater than the largest value in the table for n = 18 and p = .99. This just means that the p-value is larger than .99. This means that your data is probably normally distributed. The value W = 0,9609532124 is not in the table, but you know that it occurs between the values p = .5 and p = .9. You can interpolate (as described on the referenced webpage) to come up with an approximate p-value of .59, but in any case the value is much higher than .05, and so the random sample probably comes from a population that is normally distributed. Now the cases where W > 1 are causes for concern since I believe the value for W can’t exceed 1. There is a good chance that you have made a calculation error.

Charles

22. Stefano says:

Dear Dr. Zaionts,

Thank you very much for your great tool.
I recently downloaded the latest Release (3.5.3) for the Mac version of Excel. In this one, the SWTEST function apparently gives a #VALUE! output with range size greater than 3. Is there a way to fix this? If not, where may I find and download a previous Release?

Stefano

• Charles says:

Dear Stefano,
I don’t think I made any changes to this function since the previous release. In any case, if you send me an Excel file with your data and function results I will try to figure out what is causing this. You can send the file to my email address, which you can find at Contact Us.
Charles

23. Kevin L says:

Thank you very much for your excellent explanation and excel workbooks!

24. Salman Ahmed says:

Can I get the idea how to do the below :
Interpolating .971026 between these value (using linear interpolation)

• Charles says:

Salman,
Please look at the following webpage:
Interpolation
Charles

25. JohnM says:

My entire population is just 30 values. Can the Shapiro-Wilk test also be applied to a population rather than just a sample?
Am I correct in assuming that it is simply a test for symmmetry? My situation is that I have hundreds of datasets of 30 values and I find that even if the dataset is symmetrical the distribution of the values can be a long way from the 68-95-99.7 probability bell-curve.
For example, for one dataset, the number of entries in 1Sd bins from -2sd to 2sd is … 7,4,13,5, which produces a SW p-value of 0.43. In contrast to this distribution the “68-95-99.7” probability curve suggests that a population of 30 should be either 5, 10, 10, 4 or 4, 10, 10, 5.
Is it good practice to identify those datasets where the distribution is a long way from 68-95-99.7? If so, how is that done?

• Charles says:

John,
You can use the Shapiro-Wilk test for a population. Shapiro-Wik tests for normality not just symmetry.
Charles

• JohnM says:

Thanks Charles.
Another question that might interest other readers. I’m using your Excel method and I’ve written a Fortran subroutine to calculate the p_value. With the same input data they give the same results (as they should).
When I put the same data into http://contchart.com/goodness-of-fit.aspx I get a different p-value for the Shapiro-Wilks test.
Before I contact that website to ask them to check their processing, do you have any thoughts on the matter?

• Charles says:

John,
I have also checked my results with other programs and they match.
Charles

26. Magnus Friborg says:

I tried this on a sample of 41. I got a W = 0,90728. According to the table, the closest value is 0,92 (p = 0,01) – none are lower with the same sample size. Do I just use this value or should some measure be taken?
Also, I need to make sure that I understand the method correctly. The p-value i get from interpolating is the actual p-value and has to be lower than a threshold value (say p = 0,05) in order to reject the null hypothesis – correct?

• Charles says:

Magnus,
Yes, the approach you are using is correct. Since .90728 < .92, you can deduce that p < .01. In fact, if you sue the Real Statistics formula =PROB(41,.90728) you get the p-value = .002739. Since this is much lower than .05, you do indeed reject the null hypothesis that the data is normally distributed. Charles

• Magnus Friborg says:

Thank you very much.
I have another issue though. What is more reliable (and under what conditions), QQ plot or SW-test? I seem to get a rejection of the null hypothesis using SW, but the QQ show very small devations – or so it appears to me. Is the SW test very sensitive to large (e.g. n = 40) samples?

• Charles says:

Magnus,
I find it easier to use the SW test since it is easier to interpret its results, but both are fairly accurate. Also, since most tests are fairly robust to violations of normality, either test can show whether the data is really departing from normality. Both tests can be sued with large samples.
Charles

27. Marthen R Pellokila says:

Thank you. It is really helpful

28. Marissa says:

For n=4, my calculated value of W is 0.677. The smallest critical value for 0.01 when n=4 is 0.687. How do I interpret this result given that my W value isn’t even within any range given? I’ve double checked my data and don’t see any typos in my data recording or calculations.

• Charles says:

Marissa,
This means that the p/value is less than .01
Charles

29. Denis says:

Thank you very much for the excellent explanation!

30. Moutaz says:

This is an excellent explanation for the Shairo-Wilk’s test. This saved lots of time. However, I still have a questions in this test; how are the weight values calculated? What do the mean?

Thank you

• Charles says:

Moutaz,
You need to read the original Shapiro-Wilk paper. See Bibliography.
Charles

31. Hi, Charles,

My sample consists of 5 cases (i.e 37;105;110;150;216), resulting W = 0,9762. I want to do the SW-Test with a probability of error of 5%.
Do I have to compare my calculated W with W(p=0,95)=0,986 or with W(p=0,05)=0,762?

Ulrike

• Charles says:

Ulrike,
As described on the referenced webpage, if W =.971, then p = .874 (via interpolation between .5 and .9). Since .874 > .05, then we conclude that we don’t have evidence to reject the hypothesis that the data is normally distributed.
Another way to look at this is that if W =.971 >= .762 (the W value at .05), then the data is considered to be normally distributed.
Charles

Best regards,

Ulrike

32. Jared says:

My W value is 1.273573913 for 22 samples. I can’t find a table that goes that high, and an online calculator gave me an error. What does this mean?

• Charles says:

Jared,
It could mean that you made an error in calculating W. What is the data in your sample?
Charles

33. Stefan S. says:

Dear Charles,
first I would like to say that the Add-in seems great however I did fail to follow your example by calculating it with the RealStat Add-in for Excel 2016.

I´m using the the “example 1” data set “age”.

W 0.971066437
p-value 0.921648864
alpha 0.05
normal yes

These results are different from your manual calculations which I could follow and got the same results.

Do you have any idea what the reason is?
I would love to use the add-in but I need to be sure it is working the right way.

Best regards,
Stefan

• Charles says:

Stefan,
There are two versions of the Shapiro-Wilk test: the original version, which is described on the referenced webpage, and Royston’s version, which is described on the webpage http://www.real-statistics.com/tests-normality-and-symmetry/statistical-tests-normality-symmetry/shapiro-wilk-expanded-test/
The add-in value that you describe uses the Royston’ version. Actually, if you look at the output for W from the add-in, it will contain the formula =SHAPIRO(A4,A15). If you change the formula to =SHAPIRO(A4:A15,FALSE) you will get the value of W as calculated by Shapiro-Wilk’s original algorithm (the same is true for the p-value, which is calculated by SWTEST).
The original version works well for smaller samples, but doesn’t support larger samples. This is the advantage of the Royston version.
Charles

34. Giacomo Tabarelli says:

Hi, could you explain me why you use that b formula instead of the “standard” formula used on wikipedia for calculate W? Is there any difference? Thanks

• Charles says:

Giacomo,
It should be equivalent to formula shown in Wikipedia. I can’t recall whether I used the version in the original Shapiro-Wilk paper or elected to use the approach that I did to emphasize the symmetry aspect of the calculation.
Charles