Anderson-Darling Test
NIST/SEMATECH Section 1.3.5.14 Anderson-Darling Test
What It Is
The Anderson-Darling test is a goodness-of-fit test that assesses whether a dataset follows a specified probability distribution. It gives greater weight to the tails of the distribution compared to other tests such as the Kolmogorov-Smirnov test, making it particularly sensitive to tail departures.
When to Use It
Use the Anderson-Darling test as a formal goodness-of-fit test to complement graphical assessments such as probability plots. It is widely used to test for normality because many statistical procedures (t-tests, ANOVA, control charts) assume normally distributed data. The test is also applicable to other distributions including exponential, logistic, Gumbel, and Weibull, making it versatile for reliability and survival analysis.
How to Interpret
Compare the computed A-squared statistic (or the adjusted version for normality) against published critical values for the hypothesized distribution. Larger values of A-squared indicate greater departure from the hypothesized distribution. For the normality test, critical values at the 5% significance level are approximately 0.752 (adjusted). The Anderson-Darling test is generally more powerful than the Kolmogorov-Smirnov test, especially for detecting tail departures. When the test rejects normality, consider transformations (Box-Cox, log) or use non-parametric methods.
Assumptions and Limitations
The Anderson-Darling test requires a fully specified null distribution, meaning the distribution parameters must be either known or estimated from the data (with appropriate adjusted critical values). Observations must be independent. The test is designed for continuous distributions; for discrete data, use the chi-square goodness-of-fit test instead.
Reference: NIST/SEMATECH e-Handbook, Section 1.3.5.14
Formulas
Anderson-Darling Statistic
The test statistic measures the integrated squared difference between the empirical and hypothesized distributions, with extra weight in the tails.
Adjusted Statistic (Normality Test)
A small-sample correction factor applied when testing for normality, improving the accuracy of the critical value comparison.
Python Example
import numpy as npfrom scipy import stats
# Sample datadata = np.array([ 12.1, 11.5, 13.2, 12.8, 11.9, 12.4, 13.0, 12.6, 11.7, 12.3, 13.5, 12.0, 11.8, 12.9, 12.2, 13.1])
# Anderson-Darling test for normalityresult = stats.anderson(data, dist='norm')
print(f"A-squared statistic: {result.statistic:.4f}")print(f"\nCritical values and significance levels:")for sl, cv in zip(result.significance_level, result.critical_values): status = "REJECT" if result.statistic > cv else "FAIL TO REJECT" print(f" {sl:5.1f}%: cv={cv:.4f} -> {status}")