Kolmogorov-Smirnov test is used to check whether 2 samples follow the same distribution. x <- rnorm(50) y <- runif(50) ks.test(x, y) Two-sample Kolmogorov-Smirnov test data: x and y D = 0.52, p-value = 1.581e-06 alternative hypothesis: two-sided x <- rnorm(50) y <- rnorm(50) ks.test(x, y) Two-sample Kolmogorov-Smirnov test data: x and y D = 0.1, p-value = 0.9667 alternative hypothesis: two-sided If p-Value < 0.05 (significance level), we reject the null hypothesis that they are drawn from the same distribution. In other words, p < 0.05 implies x and y from different distributions.