Shapiro–Wilk test
The Shapiro–Wilk test is a statistical hypothesis test assessing whether a sample is consistent with a normal distribution.
Statistics Every Programmer Needs
The Shapiro–Wilk test is a statistical hypothesis test for whether a sample is consistent with a normal distribution.
- How it is used
- Uses formal normality testing to validate numeric data before analysis rather than relying solely on visual inspection.
- How deep it goes
- Defines the null hypothesis, applies a 5% decision rule, and demonstrates SciPy execution, but does not develop the test statistic formula.
- Examples
- Tests the stage1 and stage2 columns of a 20-row mds dataset using SciPy.
- What you can do after
- Evaluate normality with SciPy and interpret returned p-values against a 5% threshold.
Read how Statistics Every Programmer Needs explains Shapiro–Wilk test →
Statistics Slam Dunk
The Shapiro-Wilk test is a statistical test that evaluates whether a sample is consistent with a normal distribution.
- How it is used
- Screens variables for normality before correlation analysis and linear modeling.
- How deep it goes
- Defines the null hypothesis and cutoff, demonstrates R output, and stops short of deriving the test statistic.
- Examples
- Tests NBA hustle variables such as deflections, charges, wins, and points per game.
- What you can do after
- Diagnose distributional assumptions with base R and decide which variables remain regression candidates.
Related concepts
- shapiro.test() functionused by · The base R shapiro.test() function performs the Shapiro-Wilk test of whether numeric data are plausibly drawn from a normal distribution.
- p-valueproduces · A p-value is the probability, assuming a specified null hypothesis, of obtaining a test statistic or result at least as extreme as the observed one.
- histogramalternative to · A histogram is a representation that groups observations into bins or value ranges and records their frequencies or other distribution summaries.
- SciPyimplemented by · SciPy is an open-source Python library providing algorithms and numerical utilities for scientific and technical computing.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

