Atlas
statminds
Nonparametric (Distributional Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Kolmogorov-Smirnov Test

The engine for Distributional Discovery. This model audits the maximum distance between your sample distribution and a theoretical benchmark (1-sample) or another group (2-sample), revealing if your data fits the expected shape.

Model familyNonparametric (Distributional Model)
Hypothesistwo-tailed (also one-tailed options)
AliasesKS Test · K-S Two-Sample Test · Distributional Fit Audit
G1
Distributional Integrity Audit
Determine if your sample significantly departs from a theoretical distribution (e.g., Normal or Uniform).
G2
Global Group Comparison
Audit whether two independent groups come from the same population distribution—detecting shifts in mean, variance, or shape.
G3
Goodness-of-Fit Strike
Quantify the 'Fit' of your data against a benchmark to identify systematic sampling biases or anomalies.
Visual Overview Dashboard
1

What is it?

Kolmogorov-Smirnov (KS) Test compares the cumulative probability distributions of two samples to verify if they are drawn from the same underlying distribution.

2

When to use it

  • Two Distributions: Compare shapes, locations, and scales of Group 1 vs. Group 2.
  • Continuity: Outcomes must be measured on a continuous interval.
3

Core Idea

Plots empirical cumulative frequencies. The KS statistic (D) is the maximum vertical distance between the two CDF step lines:

Max D
4

Hypotheses

H0: Group distributions are identical
Ha: Group distributions differ in shape or location
5

How it works

  1. Construct cumulative fractions (ECDF) for both sorted samples.
  2. Compare heights of ECDFs across all observed values.
  3. Locate maximum vertical difference: D = max|F1(x) - F2(x)|.
  4. Compare D against critical value based on sample sizes.
6

Assumptions

📊 Continuity: Step functions assume no ties.
👤 Independence: Both groups are independent.
7

Effect Size

The **D statistic** itself serves as a standardized effect size indicating the maximum percentile separation between the two distributions.

8

Quick Example

ComparisonD Statp-value
Overlap (H0 retained)0.1820.640
Shifted (H0 rejected)0.5340.012
Interactive Sandbox

Kolmogorov-Smirnov Live CDF Laboratory

Change the mean difference between Group 1 and Group 2 to watch empirical step divergence.

Presets
Mean Shift Difference4.0
Group 1 Size (N1)15
Group 2 Size (N2)15
Empirical CDF (Step lines: Group 1 amber, Group 2 green; scale: 20 to 80)Red vertical bar highlights maximum distance D
Calculations Output
MetricValue
KS Distance (D)0.4667
Critical D (alpha = 0.05)0.4966
Hypothesis ResultFail to Reject
Statistical Verdict
❌ Distributions Indistinguishable
Observed D of 0.467 does not exceed critical threshold 0.497. No significant difference detected.
The 12-Stage Precision Workflow
01Cumulative Parity
Hypotheses
We test the null of 'Identical Cumulative Distributions' against the discovery of a significant 'Break in the Curve'.
02Continuity Mandate
Assumptions
Ensuring the variable is continuous—KS math loses its exactness and power if your data is discrete or contains many ties.
03EDF Forensics
Diagnostics
Utilizing Empirical Distribution Function (EDF) plots to visualize exactly where your data 'peels away' from the theoretical benchmark.
04focus
Testing if FlowMotion participants' Recovery Times follow a normal distribution before committing to parametric regression.
05Shapiro-Wilk Pivot
Alternatives
Knowing when to switch to Shapiro-Wilk if you are specifically testing for Normality—which provides higher power than pure KS.
06The D-Strike
Significance
Calculating the 'D'—the maximum vertical distance between two cumulative curves—the ultimate strike on distributional fit.
07Distributional Magnitude
Effect Size
Interpreting 'D' directly as the proportion of total data that would need to shift to make the distributions match.
08Shape Power
Sample Size
Determining the N required to ensure that even subtle shifts in distribution shape (not just the mean) reach the threshold of discovery.
09The Distance Statement
Reporting
Reporting the D-statistic and p-value clearly: 'The distribution significantly deviated from normal, D = .XX, p = .XXX.'
10ks.test Logic
Software
Executing 'ks.test' commands, ensuring the theoretical distribution parameters (e.g., mean, sd) are not estimated from the same sample.
11focus
The fatal error of estimating parameters from the data before running the KS test—which dangerously inflates the Type I error rate.
12focus
Tracing the model back to Kolmogorov and Smirnov and the foundational expansion of probability-based goodness-of-fit.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

A hypothesis is a question sharpened to a point. Ambiguity is the enemy of inference.
Logic Core
Null · H₀

H₀: Sample comes from specified distribution F₀(x) (one-sample) or both samples come from same distribution (two-sample)

Alternative · Hₐ

Hₐ: Distributions differ

Why it matters two-tailed (also one-tailed options)

Compares empirical cumulative distribution function (ECDF) to theoretical CDF (one-sample) or two empirical CDFs (two-sample). Maximum vertical distance = D statistic.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Build your analysis on rock, not sand. Verify the mathematical foundation before building the model.
Integrity Shield
5
Assumptions
0
Critical / High Severity
How to check
Quick
Inspect data type; count unique values relative to sample size
Rigorous
Plot histogram; check for discrete jumps vs smooth distribution
If violated
Consequence: KS test becomes conservative (less powerful); p-values too large Fixes: Use chi-square goodness-of-fit test for discrete data; Lilliefors test handles some discreteness Alternatives: Chi-square GOF test, exact binomial test (binary), Anderson-Darling (handles ties better)
anderson darling
How to check
Quick
Review study design; verify no subject measured multiple times
Rigorous
Check for autocorrelation in time series; examine residuals plot for patterns
If violated
Consequence: Underestimated standard errors; inflated Type I error rate Fixes: Use only independent subset; account for clustering in analysis Alternatives: Runs test (for time series), mixed models with random effects
runs test
How to check
Quick
Verify parameters come from theory/specification, not estimated from data
Rigorous
Document source of parameter values; confirm not using sample mean/SD
If violated
Consequence: Test becomes anticonservative; inflated Type I error; invalid p-values Fixes: Use Lilliefors test when parameters estimated from data Alternatives: Lilliefors test, Shapiro-Wilk test (for normality), Anderson-Darling test
shapiro wilkanderson darling
How to check
Quick
Confirm study design uses between-subjects design
Rigorous
Verify no subject appears in both groups; check for matching/pairing
If violated
Consequence: Invalid test; Type I error rate unknown Fixes: Use paired tests for dependent samples Alternatives: Sign test, Wilcoxon signed-rank test (paired data)
wilcoxon signed ranksign test
How to check
Quick
Count frequency of tied values; compute n_unique / n_total
Rigorous
Calculate proportion of ties; if >10-15% consider alternatives
If violated
Consequence: Reduced power; conservative test (may miss true differences) Fixes: Add small random noise (jittering) if appropriate; use exact tests Alternatives: Anderson-Darling test (more robust to ties), Cramér-von Mises test
anderson darling
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. D statistic — Maximum vertical distance between ECDFs (effect size)0 ≤ D ≤ 1; D=0 perfect match, larger D = greater deviation. Guidelines: <0.10 small, 0.10-0.25 moderate, >0.25 large
  2. p-value — Probability of observing D as extreme under H₀p < α (typically 0.05) → reject H₀ (distributions differ). Sensitive to sample size - always check D magnitude
  3. ECDF plots — Visual comparison of empirical vs theoretical (one-sample) or two empirical CDFs (two-sample)Maximum vertical gap = D statistic. Identify where distributions differ (location, spread, tails, shape)
  4. Critical value — Threshold D must exceed for significance at α levelCritical value ≈ 1.36/√n (α=0.05, large n). If D > critical value → reject H₀
  5. Sample sizes — n (one-sample) or n₁, n₂ (two-sample) determine power and critical valuesLarger n → smaller critical value → more power. Two-sample: balanced n₁≈n₂ optimal; very unequal reduces power
Recommended checks
  1. ECDF overlay with confidence bands — Shows sampling variability around ECDFIf theoretical CDF falls outside confidence bands → likely violation; helps distinguish sampling error from true difference
  2. CDF deviation plot (ECDF - Theoretical) — Highlights regions where distributions differ mostPositive deviations = empirical exceeds theoretical (heavier left tail or shifted right); shows location of maximum D
  3. Bootstrap D distribution — Empirical sampling distribution of D statistic; provides confidence intervalIf CI for D excludes 0 → significant difference. Shows stability of D estimate
  4. Q-Q plot (quantile-quantile) — Compare quantiles of two distributions; complements ECDFPoints on diagonal = identical distributions. Deviations show location/scale/shape differences. More intuitive than ECDF for many
  5. Comparison with Shapiro-Wilk (if testing normality) — Shapiro-Wilk more powerful for normality; compare resultsIf SW rejects but KS doesn't → suggests low power of KS. Prefer SW for normality testing
  6. Comparison with Anderson-Darling — AD more sensitive to tail differences; helpful comparisonIf AD rejects but KS doesn't → tail deviations present. AD weights tails more heavily
  7. Histogram/density overlay — Intuitive visualization of distributional differencesShows shape, location, spread differences. Easier for non-statisticians than ECDF
  8. Skewness and kurtosis (when testing normality) — Quantify specific departures from normalityNormal: skewness ≈ 0, kurtosis ≈ 3. High |skewness| (>1) or excess kurtosis suggests non-normality
  9. Power analysis / sample size sensitivity — Shows how n affects ability to detect effect of given sizeFor D=0.20 (moderate), n=100 gives ~80% power. Helps plan studies or interpret non-significant results
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Do Exam Scores Follow N(75, 15)?

Test if exam scores follow a specified normal distribution N(μ=75, σ=15). This is appropriate when theoretical distribution parameters are known a priori (e.g., from test design specifications).

# One-Sample Kolmogorov-Smirnov Test
# Test if exam scores follow N(75, 15)

# Load packages
library(ggplot2)
library(gridExtra)
library(boot)

# Set seed for reproducibility
set.seed(42)

# Generate exam score data (n=50)
# True distribution: N(73, 16) - slightly off from N(75, 15)
exam_scores <- rnorm(50, mean = 73, sd = 16)

# ====================
# 1. CHECK ASSUMPTIONS
# ====================

cat("ASSUMPTION CHECKS\n")
cat("==================\n\n")

# A1: Data is continuous
cat("1. Continuous data:\n")
cat("   Unique values:", length(unique(exam_scores)), "out of", length(exam_scores), "\n")
cat("   Data type:", class(exam_scores), "\n\n")

# A2: Independence
cat("2. Independence: Verified by design(different students)\n\n")

# A3: Fully specified distribution
cat("3. Fully specified distribution:\n")
cat("   Testing against N(75, 15) - parameters from test design\n")
cat("   NOT estimated from data(would require Lilliefors test)\n\n")

# A4: Ties check
cat("4. Ties check:\n")
ties_prop <- 1 - length(unique(exam_scores)) / length(exam_scores)
cat("   Proportion of ties:", round(ties_prop * 100, 2), "%\n")
if (ties_prop < 0.05) {
  cat("   ✓ Few ties - KS test appropriate\n\n")
} else {
  cat("   ⚠ Many ties - consider Anderson-Darling\n\n")
}

# ====================
# 2. RUN KS TEST
# ====================

cat("KOLMOGOROV-SMIRNOV TEST\n")
cat("========================\n\n")

# One-sample KS test
ks_result <- ks.test(exam_scores, "pnorm", mean = 75, sd = 15)

cat("Hypothesis Test Results:\n")
cat("  D statistic:", round(ks_result$statistic, 4), "\n")
cat("  p-value:", round(ks_result$p.value, 4), "\n")
cat("  Sample size: n =", length(exam_scores), "\n\n")

# Decision
alpha <- 0.05
if (ks_result$p.value < alpha) {
  cat("Decision: REJECT H₀ (α = 0.05)\n")
  cat("Interpretation: Scores do NOT follow N(75, 15)\n\n")
} else {
  cat("Decision: FAIL TO REJECT H₀ (α = 0.05)\n")
  cat("Interpretation: Insufficient evidence that scores differ from N(75, 15)\n\n")
}

# ====================
# 3. BOOTSTRAP CI FOR D
# ====================

cat("Bootstrap 95% CI for D statistic\n")
cat("=================================\n\n")

boot_ks <- function(data, indices) {
  d <- data[indices]
  ks_test <- ks.test(d, "pnorm", mean = 75, sd = 15)
  return(ks_test$statistic)
}

boot_results <- boot(exam_scores, boot_ks, R = 2000)
boot_ci <- boot.ci(boot_results, type = "perc")

cat("  95% CI for D: [", round(boot_ci$percent[4], 4), ",", 
    round(boot_ci$percent[5], 4), "]\n\n")

# ====================
# 4. EFFECT SIZE
# ====================

cat("EFFECT SIZE\n")
cat("============\n\n")

cat("  D statistic:", round(ks_result$statistic, 4), "\n")
cat("  Interpretation:\n")
if (ks_result$statistic < 0.10) {
  cat("    Small deviation from N(75, 15)\n")
} else if (ks_result$statistic < 0.25) {
  cat("    Moderate deviation from N(75, 15)\n")
} else {
  cat("    Large deviation from N(75, 15)\n")
}

# Cohen's d for location shift
mean_diff <- mean(exam_scores) - 75
cohens_d <- mean_diff / 15
cat("\n  Location shift(Cohen's d):", round(cohens_d, 3), "\n")
cat("    (Difference in means / theoretical SD)\n\n")

# ====================
# 5. VISUALIZATIONS (6 plots)
# ====================

# Plot 1: ECDF vs Theoretical CDF
p1 <- ggplot(data.frame(x = exam_scores), aes(x)) +
  stat_ecdf(geom = "step", color = "blue", size = 1) +
  stat_function(fun = pnorm, args = list(mean = 75, sd = 15), 
                color = "red", linetype = "dashed", size = 1) +
  labs(title = "ECDF vs Theoretical CDF",
       subtitle = "Blue = Empirical, Red = N(75, 15)",
       x = "Exam Score", y = "Cumulative Probability") +
  theme_minimal()

# Plot 2: Histogram with theoretical density
p2 <- ggplot(data.frame(x = exam_scores), aes(x)) +
  geom_histogram(aes(y = after_stat(density)), bins = 15, 
                 fill = "lightblue", color = "black", alpha = 0.7) +
  stat_function(fun = dnorm, args = list(mean = 75, sd = 15), 
                color = "red", size = 1) +
  labs(title = "Histogram with Theoretical Density",
       subtitle = "Red curve = N(75, 15)",
       x = "Exam Score", y = "Density") +
  theme_minimal()

# Plot 3: Q-Q plot
p3 <- ggplot(data.frame(sample = exam_scores), aes(sample = sample)) +
  stat_qq(distribution = qnorm, dparams = list(mean = 75, sd = 15)) +
  stat_qq_line(distribution = qnorm, dparams = list(mean = 75, sd = 15), 
               color = "red") +
  labs(title = "Q-Q Plot vs N(75, 15)",
       x = "Theoretical Quantiles", y = "Sample Quantiles") +
  theme_minimal()

# Plot 4: Deviation plot (ECDF - Theoretical CDF)
ecdf_fun <- ecdf(exam_scores)
x_seq <- seq(min(exam_scores), max(exam_scores), length.out = 200)
deviations <- ecdf_fun(x_seq) - pnorm(x_seq, mean = 75, sd = 15)

p4 <- ggplot(data.frame(x = x_seq, dev = deviations), aes(x, dev)) +
  geom_line(color = "darkgreen", size = 1) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "gray50") +
  geom_hline(yintercept = c(-ks_result$statistic, ks_result$statistic), 
             linetype = "dotted", color = "red") +
  labs(title = "CDF Deviation Plot",
       subtitle = "ECDF - Theoretical CDF(red lines = ±D)",
       x = "Exam Score", y = "Deviation") +
  theme_minimal()

# Plot 5: Bootstrap distribution of D
p5 <- ggplot(data.frame(D = boot_results$t), aes(D)) +
  geom_histogram(bins = 30, fill = "steelblue", color = "black", alpha = 0.7) +
  geom_vline(xintercept = ks_result$statistic, color = "red", 
             linetype = "dashed", size = 1) +
  labs(title = "Bootstrap Distribution of D Statistic",
       subtitle = paste0("Red line = observed D = ", round(ks_result$statistic, 3)),
       x = "D Statistic", y = "Frequency") +
  theme_minimal()

# Plot 6: Descriptive statistics comparison
stats_df <- data.frame(
  Statistic = c("Mean", "SD", "Median", "IQR"),
  Sample = c(mean(exam_scores), sd(exam_scores), 
             median(exam_scores), IQR(exam_scores)),
  Theoretical = c(75, 15, 75, 15 * 1.349)
)

p6 <- ggplot(stats_df, aes(x = Statistic)) +
  geom_point(aes(y = Sample, color = "Sample"), size = 4) +
  geom_point(aes(y = Theoretical, color = "Theoretical"), size = 4) +
  geom_segment(aes(xend = Statistic, y = Sample, yend = Theoretical), 
               linetype = "dashed", color = "gray50") +
  scale_color_manual(values = c("Sample" = "blue", "Theoretical" = "red")) +
  labs(title = "Sample vs Theoretical Statistics",
       y = "Value", color = "") +
  theme_minimal() +
  theme(legend.position = "top")

# Display all plots
grid.arrange(p1, p2, p3, p4, p5, p6, ncol = 2)

# ====================
# 6. INTERPRETATION
# ====================

cat("\nINTERPRETATION\n")
cat("===============\n\n")

cat("The one-sample Kolmogorov-Smirnov test compared exam scores\n")
cat("to the theoretical distribution N(75, 15).\n\n")

cat("Key findings:\n")
cat("  • D =", round(ks_result$statistic, 3), "(maximum CDF deviation)\n")
cat("  • p =", round(ks_result$p.value, 3), "\n")
cat("  • Sample mean:", round(mean(exam_scores), 1), "vs theoretical: 75\n")
cat("  • Sample SD:", round(sd(exam_scores), 1), "vs theoretical: 15\n\n")

if (ks_result$p.value < 0.05) {
  cat("Conclusion: Scores significantly differ from N(75, 15).\n")
  cat("The ECDF shows notable deviation from the theoretical CDF.\n")
} else {
  cat("Conclusion: Scores are consistent with N(75, 15).\n")
  cat("No significant evidence of distributional mismatch.\n")
}
05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Continuous / Ratio
Ratio
Maintain KS logic. Optimal for auditing the maximum distance between cumulative distributions.
Peak Signal
Interval
Ideal for Distributional Fit. Ensure data is truly continuous; many ties collapse the KS p-value.
Standard Precision
Ordinal
Pivot to Wilcoxon Rank-Sum or Chi-Square if data consists of discrete ranked levels.
Threshold Bias
Nominal
Abandon KS. Use Chi-Square Goodness-of-Fit to model alignment with categorical blueprints.
Model Collapse
Temporal Trajectory Audit Static Distributional Snapshot
Static Audit
Sample vs. Theory.
Stay with One-Sample KS. Verify if your data follows the expected shape law.
Multi-Group
Trajectory Gap.
Stay with Two-Sample KS. Audit the total distributional divergence between populations.
Adaptive Technical Safeguards · adaptive safeguards
excessive ties detected
  • Monte Carlo KS — Resample the null distribution to calculate exact p-values for discrete data.
  • Chi-Square GoF — Use the more robust categorical basis for highly tied samples.
estimated parameters
  • Lilliefors Strike — Apply the specialized correction when Mean/SD are estimated from the sample.
  • Anderson-Darling Test — Pivot to this elite standard for higher sensitivity to tail-deviations.
need normality only
  • Shapiro-Wilk Test — Return to the most powerful normality-specific audit available.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons
  • Compare with Anderson-Darling (more sensitive to tails)
  • Compare with Shapiro-Wilk for normality testing
  • Use Lilliefors correction when parameters are estimated
  • Examine empirical CDF plots for visual assessment
  • Two-sample K-S: examine where distributions differ most (max D location)
Interpretation Guidelines

Kolmogorov-Smirnov tests distribution fit or compares two distributions. Post-hoc tests are not applicable.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude
N/A
Recommended Measure
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

The 'Continuity Minimum': A minimum of 20 participants per group is required for a 2-sample audit. KS math requires enough temporal or score depth to construct a stable 'Cumulative Curve'.

Effect SizeParametersRequired n
Small EffectLow Divergence (D=.10)n ≈ 1000 total
Medium EffectModerate Divergence (D=.20)n ≈ 120 total
Large EffectHigh Divergence (D=.35)n ≈ 40 total
Key considerations

The 'Tie Penalty': If your data is discrete or has many identical values, the cumulative steps will 'Jump', effectively halving the sensitivity of the KS strike. Increase N by 25% for Likert or low-resolution scales.

G*Power StrategyBenchmark: Non-parametric → Goodness-of-fit (KS). Parameters: Maximum vertical distance (D), α = .05, Power = .80. Note: Power is dictated by the absolute shift in the entire shape of the data.
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Data does not speak for itself. It requires a translator. Be clear, be precise, be honest.
Narrative Arc
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Kolmogorov-Smirnov (K-S) Test for Distributional Equality
ComparisonD (Statistic)p-valueConclusion
Sample A ↔ Sample B0.28.034Significantly Different Distributions
Note. N1 = 50, N2 = 50. Comparing Sample A vs. Sample B.
D = 0.28Identifies the Divergence. There is a 28% maximum gap in the cumulative probabilities, suggesting different shapes or central tendencies.
Header glossary

The Maximum Gap. Represents the largest vertical distance between the Cumulative Distribution Functions (CDFs) of the two samples.

The Identity Probability. If p < .05, we reject the idea that the two samples were drawn from the same population distribution.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Execute Two-Sample K-S Test
ks.test(df$sample_a, df$sample_b)

# 2. Visualize the CDF Gap
plot(ecdf(df$sample_a))
lines(ecdf(df$sample_b), col='red')
Library stack
R
stats
Python
scipy.stats
Elite Forensic Strike

The K-S test is sensitive to ANY difference: location, scale, OR shape. If you only care about means, use Mann-Whitney. Use K-S to prove two populations are identical in every way.

# Execute K-S for Continuous Data (Corrected for ties)
dgof::ks.test(x, y)
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
Makes test anticonservative - inflates Type I error rate by 'double-dipping' (using data to specify null hypothesis, then testing against it)
The correction
Use Lilliefors test when parameters estimated; or use Shapiro-Wilk for normality testing; or specify parameters a priori from theory
Why it's wrong
KS test assumes continuous distribution; becomes conservative with discrete data (many ties) - underestimates true differences
The correction
Use chi-square goodness-of-fit for discrete data; Anderson-Darling handles ties better; or exact tests for small samples
Why it's wrong
Two-tailed (default) tests |F₁(x) - F₂(x)|; one-tailed tests directional shifts (F₁ > F₂ or F₁ < F₂); affects power and interpretation
The correction
Use two-tailed for general distributional differences; one-tailed when specifically testing stochastic dominance (X₁ tends to be larger than X₂)
Why it's wrong
Shapiro-Wilk more powerful for detecting non-normality (higher statistical power, especially for small-moderate samples)
The correction
Prefer Shapiro-Wilk (n < 2000) or Anderson-Darling for normality; use KS for comparing to other specified distributions or two-sample comparisons
Why it's wrong
KS test statistic distribution assumes continuous data; ties make test conservative (p-values too large, reduced power)
The correction
Check proportion of ties; if >10%, consider Anderson-Darling, Cramér-von Mises, or exact tests; jittering cautiously if appropriate
Why it's wrong
D statistic (0-1) represents maximum CDF deviation - important effect size; p-value alone doesn't indicate practical significance
The correction
Always report D statistic with interpretation (D < 0.10 = small, 0.10-0.25 = moderate, >0.25 = large); visualize ECDFs
Why it's wrong
Violates independence assumption; inflates Type I error; ignores pairing information (reduces power)
The correction
Use paired tests: Sign test, Wilcoxon signed-rank test; or analyze differences if appropriate
Why it's wrong
With n > 1000, trivial deviations become statistically significant; statistical significance ≠ practical significance
The correction
Focus on D statistic magnitude and visual inspection (ECDF plots); consider equivalence testing for large n
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Kolmogorov, A. N. (1933). Sulla determinazione empirica di una legge di distribuzione. Giornale dell'Istituto Italiano degli Attuari, 4, 83-91.
Original paper introducing the Kolmogorov-Smirnov test
[2]
Smirnov, N. V. (1948). Table for estimating the goodness of fit of empirical distributions. Annals of Mathematical Statistics, 19(2), 279-281.
Tables for KS test critical values
[3]
Lilliefors, H. W. (1967). On the Kolmogorov-Smirnov test for normality with mean and variance unknown. Journal of the American Statistical Association, 62(318), 399-402.
Lilliefors correction for KS test when parameters estimated from data
[4]
Massey, F. J. (1951). The Kolmogorov-Smirnov test for goodness of fit. Journal of the American Statistical Association, 46(253), 68-78.
Comprehensive review and applications of KS test
[5]
Razali, N. M., & Wah, Y. B. (2011). Power comparisons of Shapiro-Wilk, Kolmogorov-Smirnov, Lilliefors and Anderson-Darling tests. Journal of Statistical Modeling and Analytics, 2(1), 21-33.
Power comparison showing Shapiro-Wilk superior for normality testing
[6]
Sheskin, D. J. (2011). Handbook of Parametric and Nonparametric Statistical Procedures (5th ed.). Chapman & Hall/CRC.
Comprehensive coverage of KS test with examples and interpretation guidance
Reality has a shape. Use the KS test to find where your data breaks from the mold, for the most significant discoveries often lie in the misfit.
The Interpretive Rigor Directive
statminds · Kolmogorov-SmirnovMind reference · v2.2 · updated 2026-01-1715 of 15 sections