Skip to content

ADescribe · Guide test 109

Anderson–Darling normality test

Tests normality using an empirical distribution discrepancy that emphasizes the tails.

Runs in CodeSplashPython example validatedR example validated

Do it in CodeSplash

In the app, set it up in Analyze with one of these methods:

In Normality test (one test), choose Test = Anderson–Darling.

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Anderson–Darling normality test

40
0.60

Sinh–arcsinh shape: 0 is symmetric.

1.00

Below 1: heavier tails than normal; 1 with ε = 0 is exactly normal.

0.050

Your data

Drag a point or use ↑/↓ to change it
Sample · n = 40 · mean 0.63

If H₀ were true

A² = 0.60
  1. The reference: how A² varies across samples when H₀ is true (Null Atlas: quantiles simulated with 200,000 replicates).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .114).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

A2=−n−1n∑i=1n(2i−1)[ln⁡Φ(z(i))+ln⁡(1−Φ(z(n+1−i)))]A^2 = -n - \dfrac{1}{n}\sum_{i=1}^{n}(2i-1)\left[\ln \Phi(z_{(i)}) + \ln\left(1-\Phi(z_{(n+1-i)})\right)\right]

With your numbers

A2=0.60,n=40A^2 = 0.60,\qquad n = 40
z(i)z_{(i)}
the standardized data, sorted
Φ\Phi
the standard normal CDF
A2A^2
a weighted distance that counts tail gaps more heavily

The verdict

A² = 0.60, p = .114

p > α = .050: compatible with H₀

It weights the tails more than Lilliefors does, so it notices heavy tails sooner. As with every normality test, a small p with a large n can mean a trivial departure. The reference is simulated: the Null Atlas.

Statistic
0.596
p-value
0.1141
Anderson–Darling normality test on Sample: n = 40: A² = 0.60, p = .114. The p-value is above α = .050, so the data are compatible with H0.

Anderson–Darling normality test on Sample: n = 40: A² = 0.60, p = .114. The p-value is above α = .050, so the data are compatible with H₀.

Question and hypotheses

H0: normality with fitted mean and variance.

Assumptions

Independent identically distributed continuous observations; H0 is a normal distribution with unknown mean and positive variance. Censoring, truncation, clustering and fitted regression residuals require different calibration.

Formula

A2=−n−1n∑i=1n(2i−1)[log⁡ui+log⁡(1−un+1−i)]A^2=-n-\frac1n\sum_{i=1}^{n}(2i-1)[\log u_i+\log(1-u_{n+1-i})]

Parameters and notation

ui=Φ((x(i)−x̄)/s). One common correction is A*²=A²(1+0.75/n+2.25/n²).

Structure of the method

Sort observations, estimate their normal location and scale, transform them through the fitted normal CDF, and accumulate a tail-weighted log discrepancy. The small-sample adjustment and p-value approximation belong to that fitted-normal statistic; they are not properties of an arbitrary Anderson–Darling implementation.

Estimated and nuisance parameters

The sample mean and standard deviation are nuisance estimates under the composite normal null. The EDF is an empirical estimate, not a neural representation or trained predictor.

Settings and design choices

Specify significance level, missing-value policy and the precise standard-deviation convention. If using Monte Carlo calibration, choose replication count and seed beforehand; increasing replication count reduces numerical uncertainty without changing the scientific null.

Fitting and adaptation

Fit the normal parameters once for the observed sample. In a parametric bootstrap, simulate normal samples and re-estimate both parameters in every replicate before applying the same statistic and correction. A new dataset requires new fitting and calibration, not weight transfer or fine-tuning. Report the statistic and calibrated p-value together.

Sensitivity and robustness

Tail rounding, truncation and large outliers strongly affect the logarithmic terms. Use stable log-CDF and log-survival calculations for extreme observations. Small samples have limited power, while dependent observations or regression residuals need a null simulation reproducing their estimation structure.

How to use and calibrate

Use the normality-specific Anderson–Darling calibration matching parameter estimates and correction.

Example application

Detect tail departures from a fitted normal model.

Interpretation and pitfalls

Watch out

General known-CDF Anderson–Darling tables differ. Extreme transformed probabilities need stable log calculations.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

Normality is assessed for independent observations. For model diagnostics, test residual assumptions in context; do not automatically choose a downstream test based on a preliminary normality p-value.

Python · native

Validated — Executed successfully in the validation environment · needs numpy, scipy

import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
x=rng.normal(size=60)
print(__import__("statsmodels.stats.diagnostic",fromlist=["normal_ad"]).normal_ad(x))
Output
(np.float64(0.4573977062123191), np.float64(0.2562670959547805))
R

Validated — Executed successfully in the validation environment · needs nortest

set.seed(2026)
x <- rnorm(60)
print(nortest::ad.test(x))
Output
	Anderson-Darling normality test

data:  x
A = 0.31712, p-value = 0.5301

Sources

Statistics guide v4 (historical):
Python: Executed successfully in the validation environment · R: Executed successfully in the validation environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Unavailable local dependencies: statsmodels. Python: Not run in the reference's review: Unavailable local dependencies: statsmodels. No installation attempted. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 109, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT109.