MerQuR+Statistics Glossary

Statistics Glossary → Shapiro-Wilk test

Shapiro-Wilk testconcept

A test of whether a sample comes from a normal distribution, based on how well the sorted data agree with the ordered values expected under normality.

The data are sorted from smallest to largest and compared with the ordered values expected in a sample of the same size drawn from a normal distribution. The test statistic W measures how well the two agree and lies between 0 and 1; a W close to 1 indicates agreement with normality. The null hypothesis is 'the data are normally distributed'; if p < α, a significant departure from normality is concluded. Royston's extension allows it to be used with samples of up to a few thousand.

Among tests with the same purpose (Kolmogorov-Smirnov, Lilliefors, Anderson-Darling), Shapiro-Wilk is usually one of the most powerful. Even so, its p-value depends heavily on sample size: in large samples practically unimportant departures become significant, and in small samples even marked departures may go undetected. The test should therefore be read alongside a Q-Q plot and the skewness and kurtosis. In regression and ANOVA, normality is a property of the residuals (or of each group), not of the raw data.

An everyday example

A café measures the amount of coffee poured into espresso cups 30 times. If the machine is well calibrated, the values should spread symmetrically, in a bell shape, around some average. If Shapiro-Wilk gives W = 0.97 and p = 0.52, there is no evidence against normality; if it gives W = 0.85 and p = 0.001, the shots may, for example, be switching between two different settings.

In MerQur

It is one of the seven tests in Normality Tests. It is a checkbox in the One-Sample t-Test (on by default), in the Independent t-Test for each group and in the Paired t-Test on the differences; the 'Assumption checks: Shapiro' option tests the model residuals in Two-Way ANOVA and ANCOVA and normality per group in One-Way ANOVA. It is also reported in Correlation Analysis, Bland-Altman, the mixed models, the Bayesian t-test and ANOVA, and the residual diagnostics of STL and ARIMA.

Analyses where this concept appears

Normality TestsOne-Sample t-TestIndependent-Samples t-TestPaired t-TestOne-Way ANOVATwo-Way ANOVAANCOVACorrelation AnalysisBland-Altman Agreement AnalysisLinear Mixed Models (LMM)Nested Mixed Model (Nested LMM, Multi-Level Hierarchical Mixed Model)Likert Scale AnalysisBayesian t-Test (JZS Bayes Factor)Bayesian ANOVASTL Seasonal DecompositionARIMA Forecast

Related concepts

Normality assumptionKolmogorov-Smirnov test and Lilliefors correctionQ-Q and P-P plots