1 History and development

The Shapiro–Wilk test was developed as a formal procedure for assessing normality in sample data. It emerged during a period when statisticians were seeking practical methods to evaluate distributional assumptions without relying solely on graphical inspection. The test became widely adopted because it offered strong sensitivity to departures from normality and could be applied efficiently to relatively small datasets.

1.1 Origin of the test

The test originated from work on order statistics and the properties of samples drawn from a normal distribution. Its central idea was to compare the arrangement of observed values with the pattern expected under normality. This approach distinguished it from simpler tests that rely mainly on summary measures such as skewness or kurtosis.

1.2 Shapiro and Wilk

Samuel Shapiro and Martin Wilk introduced the test in 1965. Their formulation combined theoretical results about normally distributed samples with a numerical statistic that could be calculated from ordered observations. The method quickly attracted attention because it produced a single statistic that summarized how closely a dataset resembled a normal sample.

1.3 Later refinements and extensions

Subsequent research expanded the range of usable sample sizes and improved computational techniques. Approximations for significance values were developed, making the test more practical for routine use. Variants and related procedures were also proposed for specific data structures, software environments, and larger datasets, though the original test remained the standard reference point.

2 Statistical foundation

The Shapiro–Wilk test is built on the idea that, if a sample is normally distributed, its ordered values should follow a predictable pattern. The test uses this structure to compare observed data with the expected arrangement of a normal sample. Its mathematical basis lies in the behavior of order statistics and the covariance relationships among sample values.

2.1 Normality testing

Normality tests examine whether sample data are compatible with a normal distribution. Such tests are often used before methods that assume normal errors or normally distributed measurements. The Shapiro–Wilk test is especially valued because it is designed to detect a broad range of departures from normality rather than only extreme deviations.

2.2 Order statistics

Order statistics are the values of a sample arranged from smallest to largest. In the Shapiro–Wilk test, the ordered sample is central because normal samples have a characteristic spacing and symmetry. By examining the ranks of the data rather than their original order, the test focuses on distributional shape rather than on the sequence in which observations were collected.

2.3 Expected normal scores

Expected normal scores are the values that ordered observations would be expected to take on, on average, if they came from a normal population. The test compares the observed order statistics with these expected scores. If the sample closely matches the normal pattern, the ordered values align well with the expected structure and the test statistic is correspondingly high.

2.4 Covariance structure of samples

The test also uses the covariance structure of normal samples, which describes how ordered values tend to vary together. This information helps determine the weights applied in the statistic. By incorporating covariance, the method captures the dependence among order statistics more effectively than a simple comparison of positions alone.

3 Test statistic

The key output of the Shapiro–Wilk test is the W statistic. This value measures the degree of agreement between the sample and a normal distribution. In practice, it is paired with a p-value so that users can judge whether the observed data provide evidence against normality.

3.1 General form of the W statistic

The W statistic is based on a ratio involving the squared correlation between the ordered sample values and a weighted combination of expected normal scores. Values of W are usually between 0 and 1. A value near 1 indicates that the sample pattern is close to normal, while lower values suggest greater deviation.

3.2 Interpretation of W values

A high W value generally indicates that the sample resembles a normal distribution in its overall shape. A smaller value signals a mismatch between observed and expected order structure. The statistic should be interpreted together with the sample size and p-value, since the same W value may have different implications in small and large samples.

3.3 Relationship to sample size

Sample size affects both the distribution of W and the test’s ability to detect non-normality. With small samples, the test may have limited power to identify mild departures. With larger samples, even small irregularities can produce low p-values. For this reason, interpretation should consider both statistical results and the practical context of the data.

4 Hypotheses and decision rule

The Shapiro–Wilk test is framed as a hypothesis test. It compares the null hypothesis that the data come from a normal population against the alternative that they do not. Decisions are typically made by comparing the p-value to a chosen significance level.

4.1 Null hypothesis

The null hypothesis states that the sample is drawn from a normally distributed population. This does not mean the data must look perfectly bell-shaped, but rather that any deviations are consistent with random sampling variation.

4.2 Alternative hypothesis

The alternative hypothesis states that the data do not come from a normal distribution. This can include skewness, heavy tails, light tails, multimodality, or other departures from the expected normal pattern.

4.3 Significance level

The significance level, often written as α, is the threshold used to decide whether the result is statistically significant. Common choices include 0.05 and 0.01. If the p-value is below the chosen level, the null hypothesis is rejected.

4.4 P-value interpretation

The p-value represents the probability of obtaining a result at least as extreme as the observed one, assuming the null hypothesis is true. A small p-value suggests that the sample is unlikely to have come from a normal distribution. A large p-value does not prove normality; it only indicates insufficient evidence to reject it.

5 Computation

Although the test has a clear conceptual basis, its computation involves several steps and numerical constants. In modern practice, the calculation is usually handled by statistical software. The underlying process, however, remains rooted in sorting the data and applying coefficients derived from the normal distribution.

5.1 Ranking and sorting data

The first step is to sort the observations from smallest to largest. These ordered values are then used in the test statistic. Because the method depends on rank order, accurate sorting is essential for correct results.

5.2 Coefficient calculation

The test uses coefficients that reflect the expected behavior of normal order statistics. These coefficients are chosen to maximize the sensitivity of the statistic to departures from normality. For a given sample size, the weights are fixed and can be precomputed.

5.3 Numerical approximations

Exact calculation of p-values is not always straightforward, especially for larger samples. As a result, software often relies on numerical approximations or tabulated constants. These approximations are generally highly accurate for routine statistical use.

5.4 Software implementation

The Shapiro–Wilk test is widely available in statistical software packages and programming libraries. Users typically provide a numeric sample, and the software returns W and a p-value. Because implementations may differ slightly in handling ties, missing values, or sample-size limits, it is useful to consult documentation when precise behavior matters.

6 Assumptions and applicability

The test is most appropriate when observations are independent and measured on a continuous scale. It is useful for many standard datasets, but like all statistical procedures, it depends on conditions being reasonably satisfied. Violations of these conditions can weaken the meaning of the result.

6.1 Independent observations

Observations should be independent of one another. If the data are paired, clustered, or serially correlated, the test may reflect dependence rather than distributional shape. In such cases, alternative methods or data transformations may be more suitable.

6.2 Continuous data

The test is designed for continuous measurements. When data contain many repeated values or are heavily discretized, the ranking structure may be less informative. This can reduce the test’s effectiveness and may affect the validity of the p-value.

6.3 Sample size considerations

Sample size plays a major role in the behavior of the test. The Shapiro–Wilk test is often preferred for small to moderate samples because it has strong power in that range. Very large samples, however, can lead to statistically significant results for trivial deviations.

6.3.1 Small-sample performance

For small samples, the test can be more informative than some alternatives because it is sensitive to subtle departures from normality. Still, results should be interpreted cautiously, since very small datasets provide limited information about the overall distribution.

6.3.2 Large-sample limitations

In large samples, even minor irregularities may produce low p-values. This means the test may identify deviations that have little practical consequence. For that reason, large-sample results are often best interpreted alongside plots and substantive knowledge of the data.

7 Interpretation of results

Interpreting the Shapiro–Wilk test requires attention to both statistical output and context. A rejected null hypothesis indicates that the sample does not fit normality well, but it does not specify the exact form of the departure. A non-rejected result suggests that normality is plausible, not guaranteed.

7.1 Detecting departures from normality

The test can detect several types of non-normal behavior, including asymmetry, heavy tails, and unusual clustering. It is generally effective as an initial screening tool. However, it does not identify which part of the distribution is causing the deviation.

7.2 Sensitivity to skewness

Skewness refers to asymmetry in a distribution. The Shapiro–Wilk test often responds strongly to skewed data because the ordered values no longer follow the balanced pattern expected under normality. This makes the test useful for detecting left- or right-tailed distortions.

7.3 Sensitivity to kurtosis

Kurtosis concerns the heaviness of tails and the peakedness of a distribution. The test may flag data with unusually heavy tails or a very flat shape. Such deviations can affect methods that assume normality, especially in inference procedures sensitive to extreme values.

7.4 Practical significance versus statistical significance

A statistically significant result does not always imply a meaningful problem for analysis. In some settings, small departures from normality have little effect on conclusions. In others, even mild deviations may matter. The importance of the result depends on the analytical method, sample size, and the goals of the study.

8 Advantages and limitations

The Shapiro–Wilk test is popular because of its strong performance and simple output. At the same time, it has boundaries that users should understand. Like any statistical test, it is most useful when paired with graphical checks and substantive judgment.

8.1 Strengths of the Shapiro–Wilk test

A major strength is its sensitivity to a wide variety of non-normal patterns. It is also widely implemented and easy to interpret. For many applications, especially with moderate sample sizes, it is considered one of the most powerful normality tests available.

8.2 Comparison with other normality tests

Compared with some alternatives, the Shapiro–Wilk test often performs well in detecting departures from normality. Tests based on cumulative distribution differences or distributional moments may be less sensitive in certain settings. Nonetheless, no single test is best for every dataset.

8.3 Common limitations

The test does not explain the source of non-normality, and it may be overly sensitive in large samples. It can also be affected by ties, measurement rounding, and non-independence. As a result, it should not be treated as the sole basis for deciding whether an analysis is valid.

8.4 Effect of outliers

Outliers can influence the test strongly because they alter the ordering and spacing of values. A few extreme observations may lower the W statistic substantially. In such cases, it is useful to examine whether the outliers represent errors, rare events, or genuine features of the data.

Several other tools are used to assess normality or compare sample distributions with theoretical expectations. These methods differ in sensitivity, visualization, and computational approach. They are often used alongside the Shapiro–Wilk test rather than as direct replacements.

9.1 Anderson–Darling test

The Anderson–Darling test is a goodness-of-fit test that gives extra weight to the tails of the distribution. It can be particularly useful when tail behavior is of special interest. Like the Shapiro–Wilk test, it produces a formal significance result.

9.2 Kolmogorov–Smirnov test

The Kolmogorov–Smirnov test compares an empirical distribution with a reference distribution using the maximum vertical distance between them. It is broadly applicable, though it is often less sensitive to certain departures from normality than the Shapiro–Wilk test.

9.3 Lilliefors test

The Lilliefors test is a modification of the Kolmogorov–Smirnov procedure used when the mean and variance are estimated from the sample. It is commonly mentioned in discussions of normality testing because it addresses a limitation of the standard Kolmogorov–Smirnov framework.

9.4 Q–Q plots

Q–Q plots are graphical tools that compare sample quantiles with theoretical quantiles from a reference distribution. They are not formal tests, but they are useful for visual diagnosis. A straight-line pattern suggests approximate normality, while systematic curvature indicates departures.

10 Applications

The Shapiro–Wilk test is used in many fields where normality is an assumption or a useful approximation. It often serves as a preliminary check before fitting models, comparing groups, or conducting parametric inference. Its simplicity has made it a standard component of routine statistical analysis.

10.1 Experimental data analysis

In experimental work, researchers often use the test to evaluate whether measurement errors or response variables are approximately normal. This can influence the choice of statistical summaries, confidence intervals, and significance tests. It is especially common in laboratory and behavioral studies.

10.2 Quality control

In quality control settings, normality checks help determine whether process measurements conform to expected variation patterns. The test can support decisions about control charts, tolerance limits, and process monitoring. It is often used together with visual inspection of histograms and probability plots.

10.3 Biomedical and social science research

Biomedical and social science studies frequently analyze variables such as scores, measurements, and test outcomes that may not be exactly normal. The Shapiro–Wilk test helps determine whether transformations or nonparametric methods may be appropriate. It is commonly reported in methods sections and data analysis workflows.

10.4 Model diagnostics

The test is also used in regression and other modeling contexts to assess whether residuals are approximately normal. This is important because many inferential procedures assume normal residual behavior. When the test suggests non-normality, analysts may consider alternative models or robust methods.

11 Reporting the test

Clear reporting helps readers understand what the Shapiro–Wilk test was applied to and how the result should be interpreted. A good report includes the statistic, the p-value, and enough context to show why the test was used. It is also helpful to state whether the test was part of a broader diagnostic strategy.

11.1 Reporting W and p-values

Reports usually present the W statistic and the corresponding p-value. For example, a study might state that the data were assessed using the Shapiro–Wilk test and provide both numerical results. This allows readers to judge the strength of evidence against normality.

11.2 Stating sample size and context

The sample size should always be reported, since it affects interpretation. The context of the test matters as well: whether it was applied to raw data, residuals, or a transformed variable. Providing this information helps clarify what conclusion, if any, can reasonably be drawn.

11.3 Interpreting normality assumptions in studies

When reporting the result, it is useful to explain how it affects the analysis. If normality appears plausible, the author may note that parametric methods were used. If the test indicates non-normality, the report should mention any adjustments, such as transformation or alternative procedures. A balanced interpretation avoids overstating the importance of the test outcome.