Português

Shapiro-Wilk test

Goodness of fit and normality · reference distribution: W (tabulated)

When to use it

Check whether a sample comes from a normal distribution; it is the most powerful normality test for small and medium samples.

Null hypothesis

The data come from a normal distribution.

Assumptions

Test statistic

W = \dfrac{\left(\sum a_i\, x_{(i)}\right)^2}{\sum (x_i - \bar{x})^2}

How to report it

W = 0.96, p = .31

In R and Python

R
shapiro.test(x)
Python
stats.shapiro(x)

In Python, stats is scipy.stats and np is numpy.

Where it sits in the catalog

Goodness of fit and normality. Goodness of fit: do the data follow the expected distribution? Normality tests are the most common case and check an assumption of parametric tests.

In the decision tree

  1. What do you want to do? Check an assumption or the distribution of the data
  2. What do you want to check? Whether the data are normal
  3. How large is the sample? Small or medium

It also appears alongside other tests:

Open the decision tree