Solved – KS test for bimodal and unimodal distribution

bimodalhypothesis testingkolmogorov-smirnov testr

I am quite new to statistical tests and not sure how to exactly describe my question. I searched but could not find similar questions. Please do let me know if this is a redundant question.

I recently tried to compare a distribution between male and female. Two-sample KS test seems to be a good fit and the result is somewhat strange to me. The distributions are shown in the following graph.

Dist for male and female:

image

It is quite obvious that there are two modes in female's distribution, whereas only one exists in male's. The two sample KS test gives me somewhat weird result:

Two-sample Kolmogorov-Smirnov test

data:  male and female
D = 0.10714, p-value = 0.9834
alternative hypothesis: two-sided

The large p-value indicates insufficient evidence to reject the null hypothesis that they come from the same probability distribution, right? I think one of the reason is that my sample size is very low: (20+ for male and 50+ for female). But it is still too big — whereas the empirical distributions are bimodal and unimodal.

Is there other more appropriate tests that I should use for these samples?

Best Answer

The Kolmogorov-Smirnov test measures the supremum of the difference between two CDFs. So a good way to understand why the test is insignificant is to plot the cumulative distribution functions. In any case, looking at the two density estimates, the distributions look quite similar to me. The bimodal distribution might be an artifact of the density estimate using too small a bandwidth.