Guides / shapiro wilk test
Testing for normality: Shapiro-Wilk and the alternatives
Normality testing is the most over-applied step in applied statistics. This guide explains what Shapiro-Wilk actually measures, why its p-value is unreliable at both ends of the sample-size range, how to read a Q-Q plot instead, and — most importantly — which of your tests genuinely require normality in the first place.
The Shapiro-Wilk test assesses whether a sample could plausibly have come from a normally distributed population. Its null hypothesis is that the data are normal, so a significant result indicates a departure from normality. Its p-value depends heavily on sample size, missing real departures in small samples and flagging trivial ones in large samples, so it should be read alongside a Q-Q plot rather than on its own.
Definition
What a normality test does
A normality test asks whether your sample is consistent with having been drawn from a normal population. The null hypothesis is that it is, which reverses the usual logic: here a significant result is the unwelcome one.
| Test | How it works | Best for |
|---|---|---|
| Shapiro-Wilk | Correlates the data with the values normality would predict | Most situations; the standard choice |
| Kolmogorov-Smirnov | Largest gap between observed and expected cumulative distribution | Weaker; only use with the Lilliefors correction |
| Anderson-Darling | Weights the tails more heavily | When tail behaviour matters |
| D'Agostino-Pearson | Combines skewness and kurtosis | Larger samples; says how it departs |
Shapiro-Wilk is generally the most powerful of these and is the sensible default. Kolmogorov-Smirnov without the Lilliefors correction is genuinely poor — it assumes the population mean and standard deviation are known rather than estimated — yet it still appears in software menus and in student work.
Report the statistic as well as the p-value in every case, since the two carry different information and only one of them is independent of sample size.
Failing to reject the null means the data are consistent with normality, not that they are normal. With 15 observations, almost anything is consistent with normality, because the test has nowhere near enough information to say otherwise.
The core problem
Why the p-value misleads
The Shapiro-Wilk p-value confounds two things: how non-normal the data are, and how much data you have. This makes it unreliable at both ends of the range, and in opposite directions.
| Sample size | What happens | Consequence |
|---|---|---|
| n < 30 | Very low power | Real departures go undetected; the test reassures you falsely |
| n = 30–100 | Reasonable | The range where the test is genuinely informative |
| n > 300 | Very high power | Trivial departures reach significance; you reject normality for data that are fine |
The irony is exact and worth stating plainly. In small samples, where normality matters most because the central limit theorem cannot help you, the test is least able to detect a problem. In large samples, where normality matters least because the central limit theorem does most of the work, the test is most likely to flag one.
Simulation work has made this concrete. For the same population with mild skew, a normality test may reject about 15% of the time at n = 20 and close to 100% of the time at n = 1,000 — while the t-test's actual error rate stays acceptably near its nominal 5% throughout. The normality test and the test you care about are answering different questions, and only the second one bears on whether your conclusion is sound.
Never let a normality test alone decide your analysis. Use it as one input alongside a Q-Q plot, a histogram, and knowledge of how robust your intended test actually is. A significant Shapiro-Wilk on n = 2,000 is almost meaningless; a non-significant one on n = 12 is entirely uninformative.
Diagnostics
Reading a Q-Q plot
A quantile-quantile plot compares your observed values against the values a normal distribution would produce. If the data are normal, the points fall along a straight line.
| Pattern | Means | Typical response |
|---|---|---|
| Points on the line | Approximately normal | Proceed |
| Curves upward | Right skew | Log or square-root transform |
| Curves downward | Left skew | Square or reflect-and-transform |
| S-shaped | Heavy tails | Robust methods or a rank-based test |
| Flattened S | Light tails | Rarely a practical problem |
| Points off at one end | Outliers | Investigate individually |
This diagnostic information is the reason plots beat tests. Knowing the data are “not normal” tells you nothing about what to do; knowing they are right-skewed points directly at a log transform, and knowing they have heavy tails points at a robust or rank-based method instead.
Histograms are worth plotting alongside, though they are less diagnostic than they look. The apparent shape of a histogram depends heavily on the bin width chosen, and the same data can look approximately normal or clearly bimodal depending on that arbitrary decision. A Q-Q plot has no such tuning parameter, which is why it is the more reliable of the two for judging normality specifically. Use the histogram to spot gross features — bimodality, floor effects, a spike at zero — and the Q-Q plot to judge the shape of the tails.
Even genuinely normal data produce Q-Q plots that deviate at the extreme ends, because the most extreme observations are the most variable. Judge the middle of the plot strictly and the tails generously.
Assumptions
Which tests actually require normality
A great deal of unnecessary normality testing happens because people assume every test requires it. Most do not, and several that appear to actually require something subtly different.
| Test | Requires normality of | Robustness |
|---|---|---|
| One-sample t-test | The sampling distribution of the mean | Robust above n ≈ 30 |
| Independent t-test | Residuals within each group | Robust with equal group sizes |
| Paired t-test | The differences, not the raw scores | Often overlooked |
| ANOVA | Residuals | Robust with reasonable n |
| Linear regression | Residuals | Robust; matters mainly for small-sample intervals |
| Pearson’s r | Bivariate normality | Affects the p-value, not r itself |
| Chi-square | Nothing | Not applicable — categorical data |
| Mann-Whitney, Kruskal-Wallis | Nothing | Rank-based by design |
It assumes the difference scores are normally distributed, not the before and after scores separately. Two heavily skewed sets of scores can produce perfectly well-behaved differences. Test the differences.
Answer four questions about your design and be taken to the test that fits, with its assumptions listed and the fallback if they fail.
Use the test chooserCommon error
The assumption is about residuals, not raw data
For t-tests, ANOVA and regression, the normality assumption applies to the residuals — the part of each observation the model does not explain — not to the outcome variable as a whole.
This distinction has a practical consequence that regularly leads people astray. If two groups genuinely have different means, the combined distribution of the outcome will look bimodal or at least non-normal, even when each group is perfectly normal internally. Running Shapiro-Wilk on the pooled outcome variable will return a significant result, and it will be telling you about the group difference you are trying to test, not about a violated assumption.
The same logic explains a related confusion about predictors. Nothing in linear regression requires the predictor variables to be normally distributed. A binary predictor, a heavily skewed one, or a deliberately balanced experimental factor are all perfectly acceptable. The assumption concerns only the residuals, and testing your predictors for normality is effort spent on a requirement that does not exist.
If your outcome looks strongly non-normal but the residuals look fine, your model is working correctly and there is nothing to fix. If the outcome looks fine but the residuals do not, you have a genuine problem — usually a missing predictor or the wrong functional form.
Worked example
Worked example: interpreting the output
Three studies report Shapiro-Wilk alongside their sample size. The correct response differs in each case.
| Study | n | Shapiro-Wilk | Q-Q plot | What to do |
|---|---|---|---|---|
| A | 18 | W = .94, p = .289 | Mild upward curve | Non-significant only because n is tiny. Trust the plot: consider a transform or a rank-based test |
| B | 64 | W = .91, p = .002 | Clear upward curve | A genuine departure at an informative sample size. Transform, or use Mann-Whitney |
| C | 1,240 | W = .997, p = .019 | Points essentially on the line | Significant only because n is large. W of .997 is near-perfect. Proceed with the parametric test |
Study C is the case that causes most unnecessary work. A W statistic of .997 indicates the data are almost exactly normal; the significant p-value reflects only that with 1,240 observations the test can detect a departure far too small to affect anything. Switching to a non-parametric test here would sacrifice power for no benefit.
Study A is the one that most often goes wrong in the opposite direction. With 18 observations the researcher sees a comfortable p-value, records “normality was confirmed”, and proceeds. But the Q-Q plot shows a real curve, and at that sample size the central limit theorem offers little protection either. This is precisely the situation where the assumption matters most and where the test is least capable of detecting a violation — so the plot should override the p-value entirely.
The W statistic ranges from 0 to 1 and measures how closely the data track normality, independently of sample size. Values above about .95 indicate a close fit. Reporting W alongside p lets a reader judge whether a significant result reflects a real problem or merely a large sample.
Remedies
What to do when normality fails
In order of preference, and only once you have established that the departure is real and that your test genuinely requires the assumption.
| Option | When | Cost |
|---|---|---|
| Do nothing | n is large and the test is robust | None — often the right answer |
| Transform | Skew, with a natural transformation available | Results are on a transformed scale |
| Rank-based test | Ordinal data, or severe skew | Slight power loss; different conclusion wording |
| Robust methods | Outliers or heavy tails | Less familiar to some readers |
| Bootstrap | Small samples, any shape | Computationally heavier; needs justifying |
The first row of that table deserves more weight than it usually gets. The central limit theorem says that the sampling distribution of the mean approaches normality as the sample grows, whatever the shape of the underlying data. That is what the t-test and ANOVA actually require — not that your observations are normal, but that the mean behaves normally across hypothetical repeated samples. For moderately skewed data this holds well by about n = 30 per group, and for severely skewed data by perhaps n = 50. Above those thresholds, a significant normality test is usually telling you something true and irrelevant.
There is a real cost to switching unnecessarily. A rank-based test discards information about the spacing between values, and the conclusion it supports is subtly weaker — a statement about which group tends to score higher rather than about how much higher. If the parametric test was valid, you have given up both power and precision of interpretation for nothing.
Choosing a transformation
| Pattern | Transformation | Note |
|---|---|---|
| Moderate right skew | √x | Handles zeros |
| Strong right skew | log(x) | Requires all values > 0 |
| Severe right skew | 1/x | Reverses the ordering |
| Left skew | x², or reflect then log | Reflection changes interpretation |
| Proportions | arcsin(√p) | Now often considered unnecessary |
One caution about transforming to satisfy a test rather than to reflect the data. If a variable is skewed because it genuinely is — income, reaction times, hospital length of stay — a log transform is often the more natural scale to think on, and the transformation is substantively justified as well as statistically convenient. If it is skewed because of a handful of data-entry errors or a floor effect, transforming hides a problem that should be fixed or reported instead. Ask why the skew is there before deciding what to do about it.
After a log transform, a difference in means is a difference in geometric means, and back-transformed results are ratios rather than differences. That is often perfectly interpretable — sometimes more so — but it must be stated. Do not transform, analyse, and then report as though the units were unchanged.
Pitfalls
Six mistakes that cost marks
1. Testing the raw outcome instead of the residuals
With genuinely different group means, the pooled outcome will look non-normal even when every group is normal.
2. Treating a significant result in a large sample as a problem
Check W and the Q-Q plot. With n over a few hundred, significance is close to guaranteed.
3. Treating a non-significant result in a small sample as reassurance
With n under 30 the test has very little power. It has not established normality.
4. Testing normality for tests that do not require it
Chi-square, Mann-Whitney and Kruskal-Wallis have no normality assumption whatsoever. Running Shapiro-Wilk before them is wasted effort that occasionally leads people to abandon a perfectly appropriate test.
5. Using Kolmogorov-Smirnov without the Lilliefors correction
The uncorrected version assumes known population parameters and is badly conservative. Use Shapiro-Wilk.
6. Switching to non-parametric on the strength of the p-value alone
Decide from the plot, the sample size and the robustness of the intended test — not from one number.
Reporting
Reporting normality checks
| Situation | How to write it |
|---|---|
| Assumption met | Shapiro-Wilk indicated no departure from normality, W = .97, p = .213 |
| Large sample, trivial departure | W = .997, p = .019; given n = 1,240 and near-linear Q-Q plots, the parametric test was retained |
| Genuine departure | W = .91, p = .002; scores were right-skewed, so a Mann-Whitney U test was used |
| After transformation | Scores were log-transformed, after which residuals were approximately normal (W = .98, p = .341) |
Send your dataset and draft analysis. A named statistician verifies the assumptions that actually apply, confirms the test suits the data, and returns annotated output with APA tables.
See SPSS data analysisAnswers
Frequently asked questions
What is the Shapiro-Wilk test used for?
To assess whether a sample is consistent with coming from a normally distributed population. Its null hypothesis is that the data are normal, so a significant p-value indicates a departure. It should be interpreted alongside a Q-Q plot and the sample size rather than on its own.
What does a significant Shapiro-Wilk result mean?
That the data depart from normality more than chance alone would produce — but not necessarily by an amount that matters. In samples above a few hundred, trivial departures reach significance routinely. Check the W statistic and the Q-Q plot before changing your analysis.
Is my data normal if Shapiro-Wilk is not significant?
Not necessarily. A non-significant result means the data are consistent with normality, which in a small sample is a very weak statement. With fewer than about 30 observations the test has little power to detect even substantial departures.
Should I test the raw data or the residuals for normality?
The residuals, for t-tests, ANOVA and regression. If group means genuinely differ, the pooled outcome will look non-normal even when each group is perfectly normal, so testing the raw variable will mislead you. For a paired t-test, test the difference scores.
What should I do if my data are not normally distributed?
First check whether your test actually requires normality and whether it is robust at your sample size — often nothing needs doing. Otherwise consider a transformation for skew, a rank-based test such as Mann-Whitney for ordinal or severely skewed data, or robust methods for heavy tails and outliers.
Which normality test is best?
Shapiro-Wilk is generally the most powerful and is the standard choice. Anderson-Darling is preferable when tail behaviour matters. Avoid Kolmogorov-Smirnov without the Lilliefors correction, since the uncorrected version assumes the population parameters are known rather than estimated.
How do I read a Q-Q plot?
Points falling along the diagonal indicate approximate normality. An upward curve indicates right skew, a downward curve left skew, and an S-shape heavy tails. Some deviation at the extreme ends is expected even for normal data, so judge the middle strictly and the tails generously.
Do I need normality for a chi-square test?
No. Chi-square works with categorical counts and has no normality assumption at all. Its requirements are independent observations, raw counts rather than percentages, and expected counts large enough — conventionally at least 5 in most cells.
Send the data. Get a fixed quote.
Attach your dataset or just describe the project. A named statistician replies with a price and a deadline, usually within one working day.