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:


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?


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.

  • $\begingroup$ Thank you for the clarification. I should know that KS actually measure the biggest distance... But I still do not get your point on an artifact of the density estimate using too small a bandwidth. I think it still seems to be bimodal even if I changed the binwidth. Can you help me understand this? Thanks! $\endgroup$ – Zhiya Apr 19 '17 at 20:47
  • $\begingroup$ You can play around with the bandwidth when performing density estimation and see that if you choose a very small bandwidth then you will eventually get a density with many modes. I am not saying that your distribution is necessarily not a bi-modal one. If you play around with the bandwidth and consistently get a bi-modal density then it might just be a bi-modal distribution. $\endgroup$ – user3903581 Apr 20 '17 at 21:36
  • $\begingroup$ I see. Thanks for pointing me to bandwidth in density estimation! $\endgroup$ – Zhiya Apr 23 '17 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.