How this calculation works
Shapiro–Wilk compares a weighted contrast of ordered observations with the sample’s total centered variation. The coefficients are based on normal order statistics, with endpoint corrections in the Royston AS R94 algorithm. W near one indicates close alignment with the weighted normal-order pattern. A small lower-tail p-value indicates that the observed pattern is difficult to reconcile with independent sampling from a continuous normal distribution.
W = [Σ a_i(x_(n+1−i)−x_(i))]² / Σ(x_i−x̄)², using symmetric normal-order weights.A worked example
For 1,2,3,4,10, the calculator gives W≈0.8357883166 and p≈0.1536125843. The large final observation pulls the ordered pattern away from a balanced normal shape, but five observations provide limited evidence. A p-value above a chosen threshold is not proof that the population is normal, and it does not establish that any later analysis will be robust to an extreme observation.
Good to know
Complete samples of 3–5,000 finite observations are supported. Constant samples are undefined and rejected. The p-value relation is exact at n=3 and uses Royston approximations for larger samples. This implementation does not expose censoring corrections. Ties, discrete measurements, dependence and selected samples can affect calibration. The table previews at most fifty ordered values while W uses the entire sample.
Reference: SciPy — Shapiro–Wilk test and AS R94 reference (opens in a new tab) ↗
The statistic uses weighted order, not a histogram shape rule
Sorting does not discard the sample magnitudes. Symmetric pairs from opposite ends of the sorted sample are combined with coefficients chosen for the normal-order structure. The result is divided by centered variation, making W invariant to shifting every observation and to multiplying by a nonzero constant. Changing measurement units alone should therefore leave the normality conclusion unchanged.
A histogram can look irregular with a small sample because bin choices have a large effect. W avoids binning, but it still cannot discover features that the sample did not capture. Examine a quantile plot and the way observations were obtained alongside the numerical test. The static example figure illustrates ordered-pattern departures; it is an explanation of the calculation, not a generated diagnosis of every possible dataset.
The Anderson–Darling goodness-of-fit calculator tests a fully specified reference CDF. Its fixed-parameter calibration should not replace the normal-family procedure used here.
A normality result is not a universal approval for another test
Large samples can make tiny departures detectable, while small samples can miss important skewness or tails. Select a later model according to its target, design and robustness, rather than letting a single normality threshold automatically choose the entire analysis. If a regression model assumes normal errors, the relevant diagnostic concerns residual behavior under that model, not necessarily the raw outcome distribution.
Do not remove inconvenient extreme values solely to obtain a larger p-value. Investigate transcription errors, measurement processes and any predeclared exclusion rules. Rounded repeated measurements deserve particular care because the reference test is continuous. The implementation retains legitimate ties literally and states the limitation; it does not add random jitter or silently modify observations to make the sample appear more continuous.
A few questions, answered
Does W close to one prove normality?
No. It describes agreement with the weighted order pattern. The p-value and study context address different aspects of evidence, and neither proves a population model.
Why stop at 5,000 observations?
The cited SciPy documentation warns that p-value accuracy may deteriorate beyond that size. This page stays within the stated algorithm range rather than implying unrestricted calibration.