2
$\begingroup$

I have a question regarding the QQ plot and KS test. I have a sample which is some positions on genome, and I calculated the distance between these positions. And I generated the null distribution by randomly draw positions from genome and calculated the distance between them in the same way. (1000 times) I want to test if the distribution of the distance of my sample are the same with the distribution of distance of randomly selected positions.

First I used the QQ plot to test it, and I get the QQ plot looks like this:

QQ plot on log10 scale

The QQ plot is skewed, then I want to use KS test to see if they are from the same distribution. However, I could not get a significant P-value from using ks.test() function in R. The P-value is around 0.09...

To be clear, this is the histogram of null distribution I generated by simulation: enter image description here

Does anyone have idea why I couldn't get significant result from KS-test? Or if there is any alternative method I could use to test the difference between this two distributions? Thanks so much!

$\endgroup$
2
  • $\begingroup$ Your data are not just skew, there is also an outlier and there might be two modes. $\endgroup$
    – Peter Flom
    Jun 17 '14 at 21:16
  • $\begingroup$ Thanks so the comment. Yes there is an outlier in my data. However the KS test doesn't make any difference after excluding the outlier. $\endgroup$
    – Faith.K
    Jun 18 '14 at 14:34
2
$\begingroup$

Got too long for a comment.

It looks to me like you might (perhaps) be confusing together two different things and that might where your problem comes from - but it's not clear enough what you did to be sure.

If you want to do a KS test of the distribution in your initial Q-Q plot, the data there should be the thing passed to the KS test. What are the theoretical values in that plot? How were they obtained?

If the histogram is the simulated distribution of some statistic (as the title suggests), you wouldn't need a KS test - you just look to see where your sample value lies in that distribution.

What exactly is being displayed in the histogram? What was the sample value you're comparing with it? What are the arguments to the KS test? Is it a two-sample test or is it being compared with some theoretical distribution.

Can you please explain what you're doing at each stage and what numbers you're doing it to? (That is, if we had your original sample, how could we reproduce what you did?)

$\endgroup$
2
  • $\begingroup$ Thank you so much for your suggestion. The sample I have is some positions in human genome, and I calculated the distance between them. And the histogram is the distribution I simulated by randomly draw positions from human genome and calculated the distance. I am comparing the distance of my sample with the distance I simulated in KS test, so it's a two sample KS test. Thanks so much! $\endgroup$
    – Faith.K
    Jun 18 '14 at 14:30
  • $\begingroup$ And to be clear, what I want to test is that the sample I have (the positions and distance between them) is not random position in genome, they are more clustered compared to random positions in genome. So the theoretical values in QQ plot is the distance I got by randomly draw positions from whole genome. $\endgroup$
    – Faith.K
    Jun 18 '14 at 14:40

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.