Statistics How To

Shapiro-Wilk Test: What it is and How to Run it

Statistics Definitions > Shapiro-Wilk Test

What is the Shapiro-Wilk Test?

The Shapiro-Wilk test is a way to tell if a random sample comes from a normal distribution. The test gives you a W value; small values indicate your sample is not normally distributed (you can reject the null hypothesis that your population is normally distributed if your values are under a certain threshold). The formula for the W value is:
Shapiro-Wilk test
where:
xi are the ordered random sample values
ai are constants generated from the covariances, variances and means of the sample (size n) from a normally distributed sample.

The test has limitations, most importantly that the test has a bias by sample size. The larger the sample, the more likely you’ll get a statistically significant result.

How to Perform a Shapiro-Wilk Test

It’s rare that you’ll want to calculate the Shapiro-Wilk by hand. Many software packages can make the calculations for you:

  • Minitab:
    1. Click BASIC STATISTICS
    2. Choose NORMALITY TEST
    3. Type your data column in the VARIABLE BOX (do not fill in the reference
      box)
    4. Choose RYAN JOINER (this is the same as Shapiro-Wilk)
    5. Click OK
  • R: Although not as popular as SPSS or Excel, R does have the ability to perform the test. The argument is very simple:
    > shapiro.test(sample)
    You can find more information about the argument here.
  • SPSS: This article on Laerd.com shows how to perform the test in SPSS (it also incorporates the Kolmogorov-Smirnov test).
  • Excel: This article has a very good outline of how to run the test in Excel for samples up to 5,000. There are also instructions on how to handle larger samples.
  • MATLAB: Instructions for the test are given on the MathWorks site.
  • SAS: The SAS support site has comprehensive instructions for a variety of Goodness of Fit tests. You can find the documentation here.

Tip: Use this test in combination with a normal probability plot.

------------------------------------------------------------------------------

Confused and have questions? Head over to Chegg and use code “CS5OFFBTS18” (exp. 11/30/2018) to get $5 off your first month of Chegg Study, so you can understand any concept by asking a subject expert and getting an in-depth explanation online 24/7.

Comments? Need to post a correction? Please post a comment on our Facebook page.

Check out our updated Privacy policy and Cookie Policy