Kolmogorov-Smirnov (K-S) Test Calculator | AAT Bioquest (2024)

The Kolmogorov-Smirnov Test (K-S Test) determines sample distribution within populations without making specific distributional assumptions. The statistical analysis is based on a D-value that represents the maximum distance between the empirical distribution function and cumulative normal distribution. Simultaneously, a reported p-value is used to evaluate if the outcomes differ significantly. Although the test is primarily applied in the context of continuous distributions, the analysis can be extended to answer questions regarding other distribution types, including normal, log-normal, Weibull, exponential, and logistic distribution.

How to use this tool

1. Place the experimental data into the box on the right. This can be done by directly copying from Excel or pasting values in comma-separated, tab-separated, or space-separated formats. If the data is being entered manually, only place one value per line. The format should be the following:

Data Set 1: SampleData Set 2: Population
X1Y1
X2Y2
X3Y3
X4Y4

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.

Data Entry

Load Data

Save Data

Import from File

+

Process data

Additional Information

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

EN=n(i)/N

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.

c(α)=sqrt(-ln(α/2)*(1/2))

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.


Feedback

Have 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!

Submit request

References

This online tool may be cited as follows

MLA

"QuestGraph™Kolmogorov-Smirnov (K-S) Test Calculator."AAT Bioquest, Inc.,15Aug.2024,https://www.aatbio.com/tools/kolmogorov-smirnov-k-s-test-calculator.

APA

AAT Bioquest, Inc. (2024,August15).QuestGraph™Kolmogorov-Smirnov (K-S) Test Calculator. AAT Bioquest.https://www.aatbio.com/tools/kolmogorov-smirnov-k-s-test-calculator.
BibTeXEndNoteRefMan

This online tool has been cited in 12 publications, including

Microanatomical Properties of Energy Willow (Salix spp.) Leaves after Exposure to Potentially Toxic Elements from Wastewater Solids and Wood Ash
Authors: T{\'o}th, Csilla and Simon, L{\'a}szl{\'o} and T{\'o}th, Brigitta
Journal: Agronomy (2024): 1625

Elemental Composition of Commercially Available Cannabis Rolling Papers
Authors: Wright, Derek and Jarvie, Michelle M and Southwell, Benjamin and Kincaid, Carmen and Westrick, Judy and Perera, S Sameera and Edwards, David and Cody, Robert B
Journal: ACS Omega (2024)

Are owls technically capable of making a full head turn?
Authors: Panyutina, Aleksandra A and Kuznetsov, Alexander N
Journal: Journal of Morphology (2024): e21669

New radiocarbon and stable isotope data from the Usatove culture site of Mayaky in Ukraine
Authors: Nikitin, Alexey G and Ivanova, Svetlana and Culleton, Brendan J and Potekhina, Inna and Reich, D
Journal: SSRN Electronic Journal (2023)

Autism-related KLHL17 and SYNPO act in concert to control activity-dependent dendritic spine enlargement and the spine apparatus
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

Using Free Websites to Perform Statistical Calculations in Basic Statistics Courses at High School or College Levels
Authors: Schumm, Walter R and Dugan, Merrick and Nauman, William and Sack, Briana and Maldonado, Julian and Conyac, Cayden and Patterson, Clay
Journal: (2021)

Structures of human antibodies bound to SARS-CoV-2 spike reveal common epitopes and recurrent features of antibodies
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

Autism-linked mutations of CTTNBP2 reduce social interaction and impair dendritic spine formation via diverse mechanisms
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

A novel assay for drug screening that utilizes the heat shock response of Caenorhabditis elegans nematodes
Authors: Chen, Chih-Hsiung and Patel, Rahul and Bortolami, Alessandro and Sesti, Federico
Journal: PloS one (2020): e0240255

Kolmogorov-Smirnov (K-S) Test Calculator | AAT Bioquest (2024)

FAQs

How to use Kolmogorov-Smirnov test calculator? ›

How to use this tool
  1. Place the experimental data into the box on the right. This can be done by directly copying from Excel or pasting values in comma-separated, tab-separated, or space-separated formats. ...
  2. Verify your data is accurate in the table that appears.
  3. Press the "Calculate K-S Test" button to display results.

How to calculate the p-value on Kolmogorov-Smirnov test? ›

The p-value for the KS test is calculated by comparing the observed value of the KS statistic to the critical value of the KS statistic under the null hypothesis that the two samples come from the same distribution. The critical value of the KS statistic depends on the sample sizes.

What is the minimum sample size for Kolmogorov-Smirnov test? ›

The Shapiro–Wilk test is more appropriate method for small sample sizes (<50 samples) although it can also be handling on larger sample size while Kolmogorov–Smirnov test is used for n ≥50.

How to interpret Kolmogorov-Smirnov test results? ›

How do you interpret KS test p value? If the p-value is below the chosen significance level (commonly 0.05), we would reject the null hypothesis. It indicates significant difference; large p-value (i.e.below the chosen significance level ) suggests no significant difference.

What is a good KS score? ›

K-S should be a high value (Max =1.0) when the fit is good and a low value (Min = 0.0) when the fit is not good. When the K-S value goes below 0.05, you will be informed that the Lack of fit is significant.

What is the threshold for the K-S test? ›

To calculate this value, the KS statistic is taken into account along with the sample size of both distributions. Typical thresholds for rejecting the null hypothesis are 1% and 5%, implying that any p-value less than or equal to these values would lead to the rejection of the null hypothesis.

How to do Kolmogorov-Smirnov test manually? ›

General Steps
  1. Create an EDF for your sample data (see Empirical Distribution Function for steps),
  2. Specify a parent distribution (i.e. one that you want to compare your EDF to),
  3. Graph the two distributions together.
  4. Measure the greatest vertical distance between the two graphs.
  5. Calculate the test statistic.

What is the p-value of the Kolmogorov-Smirnov normality? ›

The p-value is the probability of obtaining a test statistic (such as the Kolmogorov-Smirnov statistic) that is at least as extreme as the value that is calculated from the sample, when the data are normal. Larger values for the Kolmogorov-Smirnov statistic indicate that the data do not follow the normal distribution.

What is the null hypothesis for the Kolmogorov-Smirnov test? ›

21.1 Kolmogorov-Smirnov Two-Sample Test

The null hypothesis (Ho) is that the two dataset values are from the same continuous distribution. The alternative hypothesis (Ha) is that these two datasets are from different continuous distributions.

What is the problem with the Kolmogorov Smirnov test? ›

The KS test can not be applied in two or more dimensions.

One can construct a statistic based on some ordering procedure, and then compute the supremum distances between two datasets (or one dataset and a curve). But the critical values of the resulting statistic are not distribution-free.

What is the formula for the Kolmogorov Smirnov test? ›

1 The Kolmogorov–Smirnov Test. (5.3) H 0 : F ( x ) = G ( x ) , all x , versus H 1 : F ( x ) ≠ G ( x ) for at least one x, where F and G are the distributions associated with two independent groups (cf. Li et al., 1996).

How to calculate KS value? ›

The KS metric is calculated by finding the maximum absolute difference between the empirical CDF of the predicted classes and the theoretical CDF of the true classes. This maximum difference is then used as the KS statistic. The higher the KS statistic, the better the performance of the classifier.

When should I use Kolmogorov-Smirnov? ›

The Kolmogorov-Smirnov test (Chakravart, Laha, and Roy, 1967) is used to decide if a sample comes from a population with a specific distribution. where n(i) is the number of points less than Yi and the Yi are ordered from smallest to largest value.

How to get p-value of K-S test? ›

You have to use D*Sqrt(samplesize) and refer the p-value as (1-table value) - that is to emphasize the reverse distribution which you can understand intuitively - a difference of zero (D=0) would imply that p-value would be 1, implies 100% of samples would have D value zero or more.

What are the assumptions of the Kolmogorov-Smirnov test? ›

Assumptions
  • The null hypothesis is both samples are randomly drawn from the same (pooled) set of values.
  • The two samples are mutually independent.
  • The scale of measurement is at least ordinal.
  • The test is only exact for continuous variables. It is conservative for discrete variables.

How do you run a Kolmogorov-Smirnov test? ›

The general steps to run the test are:
  1. Create an EDF for your sample data (see Empirical Distribution Function for steps),
  2. Specify a parent distribution (i.e. one that you want to compare your EDF to),
  3. Graph the two distributions together.
  4. Measure the greatest vertical distance between the two graphs.

How to calculate KS score? ›

The KS metric is calculated by finding the maximum absolute difference between the empirical CDF of the predicted classes and the theoretical CDF of the true classes. This maximum difference is then used as the KS statistic. The higher the KS statistic, the better the performance of the classifier.

How do you calculate Kolmogorov Smirnov in Excel? ›

To run the test, go to XLSTAT / Nonparametric tests / Distribution fitting. In the General tab, select the brand A data, the normal distribution, activate the Enter option and enter the following parameters: µ = 21.5 and sigma = 2.3. In the Charts tab, activate the Cumulative histograms option. Click on the OK button.

When should you use Kolmogorov-Smirnov test? ›

The Kolmogorov Smirnov test (KS test or K-S test) is used to compare two distributions to determine if they are pulling from the same underlying distribution. In the typical ML use case, there are two distributions (A & B) that you are trying to compare.

Top Articles
Cinemark hiring Server in Moosic, PA | LinkedIn
Cinemark hiring Server - Beer and Wine in Moosic, PA | LinkedIn
Calvert Er Wait Time
Section 4Rs Dodger Stadium
jazmen00 x & jazmen00 mega| Discover
Chris Provost Daughter Addie
Frank Lloyd Wright, born 150 years ago, still fascinates
Mawal Gameroom Download
2013 Chevy Cruze Coolant Hose Diagram
3656 Curlew St
Binghamton Ny Cars Craigslist
Cbs Trade Value Chart Fantasy Football
Mzinchaleft
Ubg98.Github.io Unblocked
Vegito Clothes Xenoverse 2
Qhc Learning
Red8 Data Entry Job
Cookie Clicker Advanced Method Unblocked
Firefly Festival Logan Iowa
Jersey Shore Subreddit
United E Gift Card
Pdx Weather Noaa
Roadtoutopiasweepstakes.con
Urban Blight Crossword Clue
Www.craigslist.com Syracuse Ny
LEGO Star Wars: Rebuild the Galaxy Review - Latest Animated Special Brings Loads of Fun With An Emotional Twist
Black Adam Showtimes Near Amc Deptford 8
Greater Keene Men's Softball
Mars Petcare 2037 American Italian Way Columbia Sc
Convenient Care Palmer Ma
The Holdovers Showtimes Near Regal Huebner Oaks
Craigslist Pa Altoona
Craigs List Palm Springs
Noaa Marine Weather Forecast By Zone
Lonely Wife Dating Club בקורות וחוות דעת משתמשים 2021
Actor and beloved baritone James Earl Jones dies at 93
Arcane Bloodline Pathfinder
Doe Infohub
Hk Jockey Club Result
Tlc Africa Deaths 2021
Sandra Sancc
Mountainstar Mychart Login
Oefenpakket & Hoorcolleges Diagnostiek | WorldSupporter
Colin Donnell Lpsg
Shiftselect Carolinas
antelope valley for sale "lancaster ca" - craigslist
Wrentham Outlets Hours Sunday
Sam's Club Fountain Valley Gas Prices
Sml Wikia
M Life Insider
Black Adam Showtimes Near Cinemark Texarkana 14
Cheryl Mchenry Retirement
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated:

Views: 6345

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.