Course contentsShow
← Data Science
Lesson 378 of 2,14510. Hypothesis Tests for MeansFree lesson

Testing Normality: Statistical Tests

Applying Shapiro-Wilk, Kolmogorov-Smirnov, and Anderson-Darling tests to formally assess normality.

Testing Normality: Statistical Tests

What you'll learn: How to use formal statistical tests to objectively determine whether your data follows a normal distribution.

Why Statistical Tests for Normality?

In the previous lesson, you learned visual methods like Q-Q plots and histograms. While helpful, these are subjective—two people might disagree on what they see. Statistical tests provide an objective, numerical answer with a p-value that tells you whether your data significantly deviates from normality.

The Three Main Tests

Shapiro-Wilk Test

The most popular test for small to moderate sample sizes (n < 50). It compares your data's order statistics against what's expected from a normal distribution. High power to detect non-normality makes it a go-to choice.

Kolmogorov-Smirnov Test

Measures the maximum distance between your sample's cumulative distribution and a theoretical normal distribution. Works for any sample size but is less powerful than Shapiro-Wilk.

Anderson-Darling Test

Similar to Kolmogorov-Smirnov but gives more weight to the tails of the distribution. Excellent for detecting outliers or heavy-tailed distributions that violate normality.

How They Work

All three tests follow the same logic:

  • Null hypothesis (H₀): Your data comes from a normal distribution
  • Alternative hypothesis (H₁): Your data does not come from a normal distribution
  • Decision rule: If p-value < α (usually 0.05), reject H₀—your data is likely not normal

Think of these tests like metal detectors at an airport: they alert you when something doesn't fit the expected pattern (normality). A low p-value is the alarm going off.

Practical Consideration

These tests are sensitive to sample size. With very large samples, even trivial deviations from normality become "significant." Always combine statistical tests with visual inspection.

Key Takeaway: Shapiro-Wilk, Kolmogorov-Smirnov, and Anderson-Darling tests provide objective p-values to assess normality, with the Shapiro-Wilk test being the most powerful for typical sample sizes.