Method · Statistics Library

Normality test (battery)

This runs a battery of normality tests (Shapiro-Wilk, Anderson-Darling, Kolmogorov-Smirnov/Lilliefors, Jarque-Bera, D'Agostino-Pearson) on one numeric variable at once, together with skewness, excess kurtosis, and a Q-Q plot, since no single test is best in every situation.

Topic indexA reference reading outside the guided chapter sequence

Understand the idea

Checking whether data plausibly came from a normal (bell-curve) distribution is a common first step before many classic statistical methods. Rather than picking just one normality test and hoping it's the right choice, this tool runs a whole BATTERY of five different tests at once, because each one has different strengths: some are more powerful for small samples, some specifically catch heavy or light tails, some are only trustworthy for large samples.

The single most important reading instruction here: look at the Q-Q plot FIRST, before any p-value. If the points hug the diagonal reference line closely, the data are close to normal; a systematic S-shaped curve or bowing away from the line signals real skew or unusual tails; a few points peeling off at the very ends flag potential outliers. The picture tells you the SHAPE of any departure in a way no single p-value can.

Here is the trap that catches almost everyone: with a LARGE sample, these tests become so sensitive they will flag even tiny, practically harmless departures from normality as 'significant'. With a TINY sample, the opposite happens: the tests have almost no power and will fail to flag almost anything, even a real, substantial departure. So a significant result does not necessarily mean the non-normality actually matters, and a non-significant result never proves the data are truly normal. Judge by the PICTURE and the SIZE of skewness/kurtosis, not by chasing a p-value threshold.

The Shapiro-Wilk test, the Anderson-Darling test and the Jarque-Bera test all check normality in different ways; Shapiro-Wilk is the usual first choice, and Jarque-Bera, which looks at skewness and tail heaviness, is meant for large samples.

Practitioner explanation

KernelStats runs Shapiro-Wilk (most powerful general-purpose test for small-to-moderate n, up to ~5000), Anderson-Darling (weights the tails more heavily than KS, reports a statistic compared against a critical value rather than a p-value; better at catching heavy/light tails), Kolmogorov-Smirnov with the LILLIEFORS correction specifically (the plain KS test is invalid when mean and SD are estimated from the same data being tested, which is exactly the situation here), Jarque-Bera (an omnibus skewness+kurtosis test, explicitly asymptotic and most trustworthy only for large samples), and D'Agostino-Pearson K-squared (combining separate skewness and kurtosis tests into one omnibus statistic).

The product states the practical relevance question directly rather than assuming normality always matters equally: t-tests and ANOVA rely on the SAMPLING DISTRIBUTION OF THE MEAN being normal, not the raw data itself, and the Central Limit Theorem makes that sampling distribution approximately normal as n grows, so these tests are ROBUST to moderate non-normality once n is roughly 30+ per group. Linear regression's normality assumption is about RESIDUALS, not raw predictors or the response; check residuals, never raw columns, for that purpose. Normality matters MOST specifically when n is small, the departure is severe (strong skew, very heavy tails), or prediction INTERVALS (not just coefficient point estimates) are needed.

A zero-variance (constant) column is refused outright with a clear message, since every one of these five tests is mathematically undefined on a column with no variability at all; this is caught explicitly rather than letting individual tests silently return degenerate or NaN results. Below n=20, the card issues an explicit warning that normality tests have low power in that regime, so a 'looks normal' verdict at small n is comparatively weak evidence, and the analyst is directed to lean on the Q-Q plot rather than the numeric verdict.

When to use it

Consider it when

Before a t-test, ANOVA, or regression, to check whether a variable (or a residual array) is approximately normally distributed, or whenever the shape of a distribution is itself of interest.

Use caution when

The sample size is so large that even trivial, practically irrelevant departures will be flagged as significant by every test in the battery (judge by skewness/kurtosis magnitude and the Q-Q plot instead of the p-values), or the sample is so small that the tests have essentially no power to detect a real departure (a 'looks normal' verdict is then weak evidence, not confirmation).

Formulas and symbols

Skewness

G1=n(n−1)n−2 m3m23/2,mk=1n∑(xi−xˉ)kG_1 = \dfrac{\sqrt{n(n-1)}}{n-2}\,\dfrac{m_3}{m_2^{3/2}}, \qquad m_k = \frac{1}{n}\sum (x_i - \bar x)^k

The bias-corrected sample skewness (scipy bias=False). 0 = symmetric; positive = long right tail; negative = long left tail.

Excess kurtosis

G2=n−1(n−2)(n−3)[(n+1)(m4m22−3)+6]G_2 = \dfrac{n-1}{(n-2)(n-3)}\left[(n+1)\left(\dfrac{m_4}{m_2^2} - 3\right) + 6\right]

The bias-corrected sample excess kurtosis (scipy fisher=True, bias=False), m_k the k-th central moment. 0 = normal-like tail weight; positive = heavy tails/sharp peak; negative = light tails/flat top.

Assumptions and checks

  • Independence of observations. Normality tests (Shapiro-Wilk, Anderson-Darling, etc.) assume the observations are independent draws from one distribution; correlated or grouped data can make the test flag 'non-normality' that is really just structure between groups, or the reverse.

    In KernelStats: Not checked by KernelStats: assumed from the study design; the test itself only evaluates the shape of the pooled values supplied.

  • Normality tests are underpowered at small n (real non-normality can go undetected) and overpowered at large n (trivial, practically meaningless deviations become statistically significant); a 'passed' or 'failed' verdict should always be read alongside a Q-Q plot or histogram, not as the final word on whether normality 'really' holds.

    In KernelStats: Not checked by KernelStats as a separate row: the card reports several tests (chosen appropriately for the sample size) side by side precisely because no single test's verdict at any given n should be read in isolation.

Alternatives

  • Histogram. A quick visual impression of shape is enough, without running the full formal test battery.
  • Distribution Fitting. You want to compare normal against several OTHER candidate distributions (lognormal, Weibull, exponential, gamma) rather than only test for normality specifically.

Worked example

Scenario

Testing body mass for normality across all 342 penguins (a mixture of three species with different typical sizes).

Result

All five tests reject: Shapiro-Wilk W = 0.959, p < .001; Anderson-Darling A-squared = 4.54 against a 5% critical value of 0.75; Lilliefors, Jarque-Bera and D'Agostino-Pearson all p < .001. Skewness = 0.47 (mild right skew), excess kurtosis = -0.72 (lighter tails than normal); the Q-Q plot shows a clear S-shaped curve.

Interpretation

The formal tests reject normality, and the Q-Q plot's S-shape confirms a real, visible departure rather than a trivial large-sample artifact, but the underlying cause here is that the pooled sample mixes three distinct species with different typical body sizes; splitting by species before testing would likely show much closer-to-normal shapes within each group.

Dataset: penguins.csv

Common misconceptions

Misconception

A significant (p < .05) normality test result on a large sample means the non-normality is practically important.

Correction

With a large sample, normality tests become so sensitive that they reject the null for tiny, practically harmless departures from normality. A significant result at large n does not mean the departure matters for your actual analysis; read the skewness/kurtosis magnitudes and the Q-Q plot to judge practical importance, not just whether the p-value crossed .05.

Read more: Misconception: statistical significance means practical importance

Misconception

A non-significant (p > .05) normality test proves the data are normally distributed.

Correction

Failing to reject normality means the test, AT THIS SAMPLE SIZE, could not detect a departure: it does not prove the data are exactly normal. This is especially weak evidence with a small sample, where every test in the battery has low power to begin with.

Read more: Misconception: the normality assumption applies to the raw data, not the residuals

References

  1. An analysis of variance test for normality (complete samples), Shapiro, S. S. and Wilk, M. B. (1965), Biometrika, 52(3-4), 591-611.
  2. Normality tests for statistical analysis: a guide for non-statisticians, Ghasemi, A. and Zahediasl, S. (2012), International Journal of Endocrinology and Metabolism, 10(2), 486-489.