Kolmogorov-Smirnov (K-S) Test Calculator
How to use this tool
|Data Set 1: Sample||Data Set 2: Population|
Users can either enter two data sets to compare distributions between populations or enter a single data set to compare sample distribution against a normal distribution. Place sample in Set 1. To add a new data set, press on the ‘+’ tab above the data entry area. If Set 2 is not included then a normally distributed data set will be assumed. Data sets can be renamed by double clicking the tab. Each dataset will generate an output with D-statistic, p-value, the alternative hypothesis, and graphical representations in the form of histogram, normal curve, and empirical distribution function.
2. Verify your data is accurate in the table that appears.
3. Press the "Calculate K-S Test" button to display results.
The Kolmogorov-Smirnov Test, more commonly referred to as the K-S Test, is a non-parametric and distribution free statistical analysis used to determine sample distribution in a population. In addition to calculating the D-statistic and p-value for the data set, the output generates the alternative hypothesis and several graphical representations in the form of histograms, normal curves, and empirical distribution functions, all of which helps in understanding sample distribution.
K-S test relies on the empirical distribution function (ECDF) to test the agreement between two cumulative distributions. For N ordered data points i.e. Y1, Y2, …, YN, the ECDF is defined to be
where n(i) is the number of points less than Yi and the values for Yi are sorted in ascending order. The equation generates an increasing step function that grows by 1/N at each ordered data point. K-S test operates by comparing the empirical distribution function to a theoretical distribution and calculating the maximum distance between the two curves, which is represented by the D value. The null hypothesis states that there is no difference between the two distributions. A p value is obtained representing the probability that the null hypothesis is true and takes into account the comparison of D with the critical value, c(α), where c(α) is a size-independent function with α as the chosen significance level for statistical significance. For p < α, the null hypothesis is rejected, suggesting that the two populations are from different distributions. Similarly, if p > α, the null hypothesis is accepted and the population distributions are deemed to be the same.
Dn,m > c(α)*sqrt((n+m)/(n*m))
The relationship of the test statistic (D value) to the significance level (α) should also be taken into consideration. For a low α value, a large difference in the populations is needed to reject the null hypothesis, indicating a higher D value. A significantly high α means that even small differences in the distributions are magnified and will lead to rejecting the null hypothesis regardless of small D values. Consequently, the null hypothesis is rejected for all data sets that are not from the same continuous distribution. K-S test is especially useful in understanding distribution of data and distinguishing among the various distribution types, such as normal, log-normal, Weibull, exponential, and logistic.
FeedbackHave a question or a feature request about this tool? Feel free to reach out to us and let us know! We're always looking for ways to improve!
This online tool may be cited as follows
|"Quest Graph™ Kolmogorov-Smirnov (K-S) Test Calculator." AAT Bioquest, Inc., 3 Oct. 2023, https://www.aatbio.com/tools/kolmogorov-smirnov-k-s-test-calculator.|
|AAT Bioquest, Inc. (2023, October 3). Quest Graph™ Kolmogorov-Smirnov (K-S) Test Calculator. AAT Bioquest. https://www.aatbio.com/tools/kolmogorov-smirnov-k-s-test-calculator.|
This online tool has been cited in 8 publications, including
Authors: de Caritat, Patrice and Grunsky, Eric and Smith, David B
Authors: Hu, Hsiao-Tang and Lin, Yung-Jui and Wang, Ueh-Ting Tim and Lee, Sue-Ping and Liou, Yae-Huei and Chen, Bi-Chang and Hsueh, Yi-Ping
Journal: PLoS biology (2023): e3002274
Authors: Craig, Mia
Authors: Schumm, Walter R and Dugan, Merrick and Nauman, William and Sack, Briana and Maldonado, Julian and Conyac, Cayden and Patterson, Clay
Authors: Rich, Debra J
Authors: Barnes, Christopher O and West Jr, Anthony P and Huey-Tubman, Kathryn E and Hoffmann, Magnus AG and Sharaf, Naima G and Hoffman, Pauline R and Koranda, Nicholas and Gristick, Harry B and Gaebler, Christian and Muecksch, Frauke and others,
Journal: Cell (2020): 828--842
Authors: Shih, Pu-Yun and Hsieh, Bing-Yuan and Tsai, Ching-Yen and Lo, Chiu-An and Chen, Brian E and Hsueh, Yi-Ping
Journal: Acta neuropathologica communications (2020): 1--19
Authors: Chen, Chih-Hsiung and Patel, Rahul and Bortolami, Alessandro and Sesti, Federico
Journal: PloS one (2020): e0240255