A test of normality is a statistical hypothesis test that checks whether your sample data likely came from a normally distributed population. You interpret it primarily by looking at the p-value: if the p-value is greater than your chosen significance level (usually 0.05), you do not reject normality; if it is less than 0.05, you conclude the data are not normal. The test statistic itself (e.g., W for Shapiro–Wilk, D for Kolmogorov–Smirnov) is less intuitive and rarely reported beyond its p-value.
Formula
The Shapiro–Wilk test computes a statistic W that measures how well the ordered sample values match the expected order statistics of a normal distribution. The formula is:
W = ( (∑ ai x(i))² ) / ( ∑ (xi − x̄)² )
where x(i) are the ordered sample values, ai are constants derived from the expected values of the order statistics of a normal distribution (they depend only on sample size n), and x̄ is the sample mean. The p-value is the probability of observing a W value as extreme as the one computed, assuming the data are truly normal. Smaller W values indicate larger deviations from normality. Because the ai constants are tabulated, the p-value is almost always obtained from statistical software rather than hand-calculated.
Worked Example
Suppose you have a sample of 30 measurements, and your software reports a Shapiro–Wilk statistic of W = 0.95. You set your significance level at α = 0.05. The p-value associated with W = 0.95 for n = 30 is approximately 0.2 (this is a typical value; exact values come from the test’s distribution).
Because p = 0.2 > 0.05, you fail to reject the null hypothesis. The interpretation: there is not enough evidence to say your data deviate from a normal distribution. You may proceed with parametric tests that assume normality, such as a t-test or ANOVA, with reasonable confidence.
Assumptions
- The sample is randomly drawn from the population.
- Observations are independent of each other.
- The test is sensitive to sample size: with large samples, even trivial deviations become significant.
- The Shapiro–Wilk test is most powerful for small to moderate samples (n < 50), while the Anderson–Darling and Kolmogorov–Smirnov tests are alternatives.
How to Choose a Normality Test
Different normality tests have different strengths, and your choice affects interpretation:
- Shapiro–Wilk: Best overall for small samples (n < 50). It is the default in most statistical software for n ≤ 5000.
- Kolmogorov–Smirnov (Lilliefors correction): Used for larger samples, but it is less powerful because it compares the sample to a normal distribution with estimated parameters.
- Anderson–Darling: More sensitive to deviations in the tails of the distribution; often used in quality control.
- Jarque–Bera: Based on skewness and kurtosis; works well for large samples but is unreliable for small ones.
In practice, most analysts use Shapiro–Wilk for n < 50 and either Shapiro–Wilk or Anderson–Darling for larger samples. The choice rarely changes the conclusion if the data are clearly normal or clearly non-normal; it matters most for borderline cases.
Common Mistakes in Interpretation
- Confusing “fail to reject” with “prove normal”: A high p-value does not prove normality; it only says the sample is consistent with normality. With a small sample, many non-normal distributions can pass the test.
- Ignoring sample size: With n = 1000, a p-value of 0.01 may indicate a trivial deviation that has no practical impact on your analysis. With n = 10, a p-value of 0.10 may be due to low power, not true normality.
- Using the wrong significance level: Always set α before running the test. If you test many variables, consider a multiple-comparison correction.
- Looking only at the test, not the plot: A histogram or Q-Q plot can show whether a deviation is due to outliers, skewness, or a heavy tail—information the p-value does not give.
- Applying the test to residuals vs. raw data: For regression, normality should be checked on the residuals, not the raw outcome variable.
What to Do If Data Are Not Normal
Rejecting normality does not mean your analysis is doomed. You have several options:
- Use non-parametric tests: Mann–Whitney U instead of independent t-test, Wilcoxon signed-rank instead of paired t-test, Kruskal–Wallis instead of one-way ANOVA. These do not assume normality.
- Transform the data: Log, square root, or Box–Cox transformations can often make skewed data more normal.
- Use robust methods: Trimmed means, bootstrapping, or robust standard errors can handle non-normality.
- Proceed anyway if the sample is large: The Central Limit Theorem often makes parametric tests valid for large samples (n > 30–40) even when the population is not normal, especially for means.
Always check the visual evidence (histogram, Q-Q plot) alongside the test. A p-value alone cannot tell you whether the deviation is practically significant.
Frequently Asked Questions
What does a p-value of 0.05 exactly mean in a normality test? It means that if the data were truly normal, you would see a test statistic as extreme as yours about 5% of the time by random chance. If your p-value is below 0.05, you reject normality; if above, you do not. The threshold is arbitrary—some fields use 0.01 for stricter evidence.
Can I use a normality test on a sample of 5? Yes, but the test has very low power—it will almost never reject normality even if the data are clearly non-normal. With tiny samples, rely more on domain knowledge and graphical checks, and consider that parametric tests may still be robust.
Is it better to use Shapiro–Wilk or Kolmogorov–Smirnov? For most purposes, Shapiro–Wilk is preferred because it has better power for small and moderate samples. Kolmogorov–Smirnov is often taught historically but is less sensitive; use it only when you need to compare against a fully specified normal distribution (known mean and variance), which is rare.
What if my data fail normality but I need to run a t-test anyway? You can use a non-parametric alternative (Mann–Whitney U) or a Welch t-test that does not assume equal variances. With a large enough sample (n > 30 per group), the t-test is often still valid due to the Central Limit Theorem. Report both the test result and the normality check so readers can judge.
Does the normality test need to be run on the raw data or the residuals? For regression or ANOVA, run it on the residuals (observed minus predicted values). The raw outcome variable may be non-normal even when residuals are fine, because the mean structure can shift the distribution. The assumption is about errors, not the marginal distribution.
Why do my p-values differ between Shapiro–Wilk and Anderson–Darling? They use different weighting of deviations: Shapiro–Wilk emphasizes the middle of the distribution, while Anderson–Darling gives more weight to the tails. If your data have outliers or heavy tails, the tests can disagree. In that case, inspect the Q-Q plot to see where the deviation lies.
Limits of Normality Tests
Normality tests answer only one question: “Is the deviation from normal large enough to be statistically detectable?” They do not tell you how much the deviation matters for your analysis. For large samples, tiny deviations become “significant” even though parametric tests remain valid. For small samples, the tests are too weak to catch real deviations. Therefore, always combine the test with graphical assessment and consider the robustness of your planned analysis. In many applied fields, moderate non-normality is acceptable if the sample size is sufficient and the test you plan (e.g., t-test) is known to be robust.
Related
Formula used
in n | Sample size | - | 30 | 3 in w | Shapiro-Wilk W statistic | - | 0.95 | 0 in a | Significance level (alpha) | - | 0.05 | 0.001 out p | Approximate p-value | - | 0.2 | 4 out norm | Normality conclusion | - | p > a ? "Do not reject normality" : "Reject normality" | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- Normality to g/L Converter & Formula29.220 g/L
- Normality to meq/mL Conversion Calculator1.0000 meq/mL
- Normality Test Q-Q Plot: How to Read It
- Normality Test Results: How to Analyze Them
- Normality Slay the Spire?
- Normality Test for Paired t Test: How to Check