Kolmogorov-Smirnov Test
You'll learn how to use the K-S test to quantitatively check if your sample data follows a normal distribution.
What Is the Kolmogorov-Smirnov Test?
While the Shapiro-Wilk test (from the previous lesson) focuses on detecting departures from normality, the Kolmogorov-Smirnov (K-S) test takes a slightly different approach. It measures the maximum distance between your sample's cumulative distribution function (CDF) and the theoretical normal CDF you're testing against.
Think of it like this: imagine overlaying two staircase graphs—one built from your data points and one representing a perfect normal distribution. The K-S test finds the largest vertical gap between these two staircases. If that gap is too large, your data probably doesn't come from a normal distribution.
How It Works
The K-S test compares every single point in your ordered sample against where it should be if the data were perfectly normal (with the same mean μ and standard deviation σ). The test statistic is simply the biggest deviation it finds. A small maximum distance suggests your data fits the normal distribution well; a large distance raises red flags.
The test produces a p-value: if it's below your threshold (commonly 0.05), you reject the hypothesis that your data is normally distributed.
When to Use It
The K-S test works best with larger sample sizes and is particularly sensitive to differences in the middle of the distribution. It's less sensitive to tail behavior than Shapiro-Wilk, making it a complementary tool rather than a replacement. When testing normality, many practitioners use K-S alongside visual methods like Q-Q plots for a complete picture.
Key Takeaway: The Kolmogorov-Smirnov test quantifies how well your sample's CDF matches a theoretical normal distribution by measuring the maximum distance between them—larger distances indicate non-normality.