Statistics Quest

Shapiro–Wilk normality test

Tests whether a sample is consistent with a normal population by measuring how well the ordered data line up with expected normal order statistics.

W=(∑i=1nai x(i))2∑i=1n(xi−xˉ)2W = \frac{\left(\sum_{i=1}^{n} a_i\,x_{(i)}\right)^2}{\sum_{i=1}^{n}(x_i - \xbar)^2}
W is at most 1; values well below 1 indicate non-normality. p-values from Royston's (1995) approximation, 3 ≤ n ≤ 5000.
x(i)x_{(i)}
The i-th smallest observation.
aia_i
Coefficients derived from the expected values of normal order statistics.

When to use

As supporting evidence, together with a Q–Q plot, when a method assumes normality (small-sample t procedures, residuals of a regression or ANOVA). H₀: the population is normal.

Assumptions

Independent observations; continuous data (many tied values lower W).

How to interpret

  • Small p: evidence against normality — look at the Q–Q plot to see how (skew, heavy tails, outliers) and whether it matters for your method.
  • Large p: the sample is consistent with normality, which is not proof of normality; small samples rarely reject anything.
  • In large samples, trivial departures give tiny p-values while the CLT makes t procedures robust anyway.

Common mistakes

  • Testing the raw outcome instead of the residuals (ANOVA/regression) or the differences (paired t).
  • Treating p > 0.05 as "the data are normal".
  • Switching method mechanically on the test result instead of judging the size and impact of the departure.

Example

Ten values 2.1, 3.4, 1.9, 5.6, 2.8, 3.1, 4.0, 2.5, 3.3, 2.9: W=0.899W = 0.899, p=0.21p = 0.21. No strong evidence against normality, but with n = 10 the test has little power: inspect a Q–Q plot, where the single large value 5.6 hints at right skew.