Questions tagged [kolmogorov-smirnov]

The Kolmogorov-Smirnov test is a test for goodness of fit of data to a distribution. It is often used to test whether a variable is normally distributed.

Filter by
Sorted by
Tagged with
159
votes
2answers
213k views

How to determine which distribution fits my data best?

I have a dataset and would like to figure out which distribution fits my data best. I used the fitdistr() function to estimate the necessary parameters to ...
44
votes
3answers
10k views

Kullback–Leibler vs Kolmogorov-Smirnov distance

I can see that there are a lot of formal differences between Kullback–Leibler vs Kolmogorov-Smirnov distance measures. However, both are used to measure the distance between distributions. Is there a ...
37
votes
4answers
2k views

Intuitive explanation of Kolmogorov Smirnov Test

What is the cleanest, easiest way to explain someone the concept of Kolmogorov Smirnov Test? What does it intuitively mean? It's a concept that I have difficulty in articulating - especially when ...
35
votes
3answers
24k views

Is Kolmogorov-Smirnov test valid with discrete distributions?

I'm comparing a sample and checking whether it distributes as some, discrete, distribution. However, I'm not enterily sure that Kolmogorov-Smirnov applies. Wikipedia seems to imply it does not. If it ...
34
votes
2answers
113k views

What is the difference between the Shapiro-Wilk test of normality and the Kolmogorov-Smirnov test of normality?

What is the difference between the Shapiro-Wilk test of normality and the Kolmogorov-Smirnov test of normality? When will results from these two methods differ?
27
votes
3answers
39k views

Is it meaningful to test for normality with a very small sample size (e.g., n = 6)?

I have a sample size of 6. In such a case, does it make sense to test for normality using the Kolmogorov-Smirnov test? I used SPSS. I have a very small sample size because it takes time to get each. ...
26
votes
3answers
4k views

Why does the Kolmogorov-Smirnov test work?

In reading about the 2-sample KS test, I understand exactly what it is doing but I don't understand why it works. In other words, I can follow all the steps to compute the empirical distribution ...
25
votes
1answer
13k views

Kolmogorov-Smirnov with discrete data: What is proper use of dgof::ks.test in R?

Beginner questions: I want to test whether two discrete data sets come from the same distribution. A Kolmogorov-Smirnov test was suggested to me. Conover (Practical Nonparametric Statistics, 3d) ...
20
votes
2answers
14k views

2 Sample Kolmogorov-Smirnov vs. Anderson-Darling vs Cramer-von-Mises

I was wondering what are the criteria to use Kolmogorov-Smirnov, Cramer-von-Mises, and Anderson-Darling when comparing 2 ECDFS. I know the mathematics of how each differ, but if I have some ECDF data, ...
19
votes
1answer
12k views

Kolmogorov–Smirnov test vs. t-test

I'm having some difficulty in understanding the interpretation of the 2 sample KS test, and how it is different from a regular t test between 2 groups. Lets say I have males and females doing some ...
19
votes
1answer
13k views

Can I use Kolmogorov-Smirnov to compare two empirical distributions?

Is it OK to use the Kolmogorov-Smirnov goodness-of-fit test to compare two empirical distributions to determine whether they appear to have come from the same underlying distribution, rather than to ...
18
votes
2answers
74k views

Understanding Kolmogorov-Smirnov test in R

I'm trying to understand the output of the Kolmogorov-Smirnov test function (two samples, two sided). Here is a simple test. ...
18
votes
2answers
15k views

Test for IID sampling

How would you test or check that sampling is IID (Independent and Identically Distributed)? Note that I do not mean Gaussian and Identically Distributed, just IID. And idea that comes to my mind is ...
16
votes
4answers
5k views

Which to believe: Kolmogorov-Smirnov test or Q-Q plot?

I'm trying to determine if my dataset of continuous data follows a gamma distribution with parameters shape $=$ 1.7 and rate $=$ 0.000063. The problem is when I use R to create a Q-Q plot of my ...
16
votes
1answer
6k views

Does it make sense to perform a one-tailed Kolmogorov-Smirnov test?

Is it meaningful and possible to perform a one-tailed KS test? What would the null hypothesis of such a test be? Or is the KS test inherently a two-tailed test? I would benefit from an answer that ...
15
votes
3answers
25k views

My distribution is normal; Kolmogorov-Smirnov test doesn't agree

I have a problem with the normality of some data I have: I've done a Kolmogorov test which says it isn't normal with p=.0000, I don't understand: the skewness of my distribution =-.497, and the ...
15
votes
3answers
5k views

Can I use Kolmogorov-Smirnov test and estimate distribution parameters?

I've read that Kolmogorov-Smirnov test should not be used to test the goodness of fit of a distribution whose parameters have been estimated from the sample. Does make sense to split my sample in two ...
15
votes
1answer
12k views

Test for difference between 2 empirical discrete distributions

I have test data where I have several large samples from discrete distributions which I am using as empirical distributions. I am wanting to test whether the distributions are actually different and ...
14
votes
3answers
15k views

Is there a multiple-sample version or alternative to the Kolmogorov-Smirnov Test?

I am comparing the size distribution of trees in six pairs of plots where one plot received a treatment and the other a control. Using a Kolmogorov-Smirnov test on each pair of plots I find that $p$ ...
14
votes
1answer
8k views

Is there an alternative to the Kolmogorov-Smirnov test for tied data with correction?

I've got a bunch of data from two samples (control and treated), each containing several thousand values which are to undergo significance testing in R. Theoretically, the values should be continuous, ...
13
votes
2answers
1k views

Is there a simple equivalence test version of the Kolmogorov–Smirnov test?

Has two one-sided tests for equivalence (TOST) been framed for the Kolmogorov–Smirnov test to test the negativist null hypothesis that two distributions differ by at least some researcher-specified ...
13
votes
3answers
8k views

Two-dimensional Kolmogorov-Smirnov

I would like to run some two dimensional Kolmogorov-Smironov tests to determine whether a two-dimensional distribution fits with a reference. Is there any package or application that I could I use in ...
13
votes
3answers
10k views

Clustering probability distributions - methods & metrics?

I have some data points, each containing 5 vectors of agglomerated discrete results, each vector's results generated by a different distribution, (the specific kind of which I am not sure, my best ...
12
votes
2answers
19k views

If my histogram shows a bell-shaped curve, can I say my data is normally distributed?

I created a histogram for Respondent Age and managed to get a very nice bell-shaped curve, from which I concluded that the distribution is normal. Then I ran the normality test in SPSS, with n = 169. ...
12
votes
2answers
22k views

“Ties should not be present” in one-sample Kolmgorov-Smirnov test in R

I am going to use the Kolmogorov-Smirnov test to test normality of MYDATA in R. This is an example of what I do ks.test(MYDATA,"pnorm",mean(MYDATA),sd(MYDATA)) ...
11
votes
2answers
25k views

Correlation between dichotomous and continuous variable

I am trying to find the correlation between a dichotomous and a continuous variable. From my ground work on this I found that I have to use independent t-test and the precondition for it is that the ...
11
votes
2answers
5k views

Book for non parametric statistics

What would be a good book for non-parametric statistics. Not just the introduction but advanced level. Also I am looking at something I can use for learn and not for reference. In particular I am ...
10
votes
2answers
4k views

Can you calculate the power of a Kolmogorov-Smirnov test in R?

Is it possible to do a power analysis for a 2-sided Kolmogorov Smirnov test in R? I am testing whether two empirical distributions differ using ks.test(), and am looking to add a power analysis. I ...
10
votes
1answer
5k views

Is there a multivariate two-sample Kolmogorov-Smirnov test?

Is there a multivariate alternative to two-sample Kolmogorov-Smirnov test? What I mean is a test that can be used to check whenever two underlying multidimensional distributions differ.
10
votes
1answer
1k views

Why can't one generalize the Kolmogorov-Smirnov test to 2 or more dimensions?

The question says it all. I've read both that one can't generalize KS to a dimension equal or larger than two, and that famous implementations like that in Numerical Recipes are simply wrong. Could ...
10
votes
2answers
1k views

Measuring goodness-of-fit in a model that combines two distributions

I have data with a double peak that I'm trying to model, and there's enough overlap between the peaks that I can't treat them independently. A histogram of the data might look something like this: I'...
10
votes
2answers
3k views

Kolmogorov-Smirnov two-sample $p$-values

I am using the Kolmogorov–Smirnov two-sample test to compare distributions, and I noticed a $p$-value is frequently reported as the test statistic. How is this $p$-value determined? I know it's ...
9
votes
2answers
17k views

ks.test and ks.boot - exact p-values and ties

I am confused by the behaviour of ks.test (package stat) a) in the presence of ties and b) if one-sided while doing a two-sample test. Documentation: "Exact p-values are not available for the two-...
9
votes
1answer
474 views

What is the two-sample CDF of of $D^{+}$ and $D^{-}$ from the one-sided Kolmogorov-Smirnov Test?

I am trying to understand how to obtain $p$-values for the one-sided Kolmogorov-Smirnov test, and am struggling to find CDFs for $D^{+}_{n_{1},n_{2}}$ and $D^{-}_{n_{1},n_{2}}$ in the two-sample case. ...
9
votes
2answers
2k views

Using Kolmogorov–Smirnov test

A newbie question (please provide detailed answers): I am trying to use the Kolmogorov–Smirnov test. I managed to calculate the difference between the empirical points and the theoretical distribution ...
9
votes
1answer
2k views

Kolmogorov-Smirnov test?

I am studying disturbance caused by ship traffic to a small seabird. I observed focal animals for a set amount of time and record whether or not they fly from the water during the observation. This ...
8
votes
1answer
1k views

Kolmogorov Smirnov Z vs Mann Whitney U small sample size n= 15?

I have a small sample size of 15. I want to see if there is a difference in the nutrient intakes between two independent variables, group 1 n = 11, group 2 n= 4. The data is not normally distributed. ...
8
votes
2answers
13k views

Testing whether data follows T-Distribution

I am involved in a project where I need to check whether my data follows a T-distribution with N degrees of freedom for a given value of N. I know that Kolmogorov-Smirnoff can be used, but is there ...
8
votes
1answer
939 views

Why “supremum”, not “maximum” in Kolmogorov-Smirnov test?

Why the test function in Kolmogorov-Smirnov test takes the supremum of the set of differences, not maximum? When maximum (greatest element) of a set does not exist then supremum may exist, but if ...
8
votes
2answers
3k views

Inconsistent normality tests: Kolmogorov-Smirnov vs Shapiro-Wilk

I'm currently looking into some data that was produced by an MC simulation I wrote - I expect the values to be normally distributed. Naturally I plotted a histogram and it looks reasonable (I guess?): ...
8
votes
1answer
15k views

two-sample Kolmogorov-Smirnov test p-value in R confusion

I'm confused about the appropriate interpretation of p-values returned by the two-sample Kolmogorov-Smirnov test (ks.test) in R. In slide 23 of this presentation about non-parametric two-sample ...
8
votes
1answer
1k views

Can you use the Kolmogorov-Smirnov test to directly test for equivalence of two distributions?

There has been talk on other questions of how one might use the Two One-Sided Tests (TOST) approach for the Kolmogorov-Smirnov (KS) test, but I was wondering whether it was possible to directly use ...
8
votes
2answers
3k views

Comparing two ECDFs using Kolmogorov-Smirnov test (alternative hypothesis)

I am taking measurements of a computer system performance over time and I'd like to understand if the performance is degrading or improving as time passes.. After doing some research, I picked the KS ...
7
votes
3answers
5k views

A naive question about the Kolmogorov Smirnov test

I would like to test if they are distributed according to an exponential distribution. I can apply the Kolmogorov-Smirnov in python using ...
7
votes
2answers
579 views

How can the F-test reject the null hypothesis while the KS test does not?

Suppose I have two datasets, $\mathbf{a}$ and $\mathbf{b}$. I want to test whether the two datasets are different in a statistically significant way. To compute the F-test, I take the ratio of the ...
7
votes
1answer
4k views

Is the Kolmogorov-Smirnov-Test too strict if the sample size is large?

I often hear the statement that the KS-Test (for comparing two distributions described by two samples) is too strict if the sample size is rather large, meaning that the 0-hypothesis of equal ...
7
votes
1answer
721 views

Kolmogorov Smirnov conflicts with visual data

I recorded the length of 197 nursing care episodes. My normalised data $(x-\mu)/\sigma$ looks like this: Kolmogorov-Smirnov gives me a p-value of 0.14. Can't be right surely?! Am I misinterpreting my ...
7
votes
3answers
7k views

Comparing two (or more) discrete distributions

I would like to know what the most powerful way of comparing two (or more) discrete distributions is. I know that the Kolmogorov-Smirnov test could be used (if corrected for the discrete ecdfs), and/...
7
votes
1answer
1k views

Is my data distribution normal? (Tried Shapiro and Kolmogornov-Smirnov tests)

I have a 1D data set with 83163 data points, and I would like to know whether the data follows a normal distribution. I tried using shapiro.test and ks.test in R: d is a vector containing the data ...
7
votes
3answers
2k views

How to check for the distribution stability?

I need for verifying that the training set I'm using to build a model is equally distributed to the test set. The model is for prediction purposes and I think it is necessary the 2 samples are ...

1
2 3 4 5
11