Skip to main content
18 events
when toggle format what by license comment
Nov 14, 2012 at 10:41 comment added Adam Ryczkowski @Tito: From the perspective of KS test your datapoint is the observed occurance of a given SNP, not the bin (i.e. row)
Nov 14, 2012 at 8:57 comment added Tito Candelli @whuber i looked up the documentation you gave me on KS-test and concluded that it is not a good test for this situation as well. what i'm comparing is a profile; not a set of measurements of condition A vs condition B. what i'm saying is that the first first datapoint of the background should be compared to the first datapoint in the selected the second in the background to the second in the selected and so on... is it possible to use the spearman correlation as a test of Indipendence in these cases?
Nov 13, 2012 at 17:03 comment added Adam Ryczkowski @whuber. Thank you. I didn't know that.
Nov 13, 2012 at 16:39 comment added whuber Although it does not matter for these data, because the difference is so obvious, dgof::ks.test is not applicable to this situation. Its documentation appears to state that when comparing discrete distributions, one of them must be a known reference and not estimated from data. Furthermore, the p-value computed for sets with more than $30$ data values is only approximate and "conservative." In such a case, one is likely better off with a permutation test or a chi-square test (available in base R).
Nov 13, 2012 at 13:15 comment added Adam Ryczkowski @Tito. Take a look at this site. I believe all answers are better put there than I would have.
Nov 13, 2012 at 12:57 comment added Tito Candelli @AdamRyczkowski Thank you, this method gives me what i want, however, i would like to understand how the result is achieved. how does this test account for the fact that the total number of trials is so different in the two samples? could you explain a bit how it works? unfortunately i'm not too savvy in statistics. :(
Nov 13, 2012 at 12:55 vote accept Tito Candelli
Nov 14, 2012 at 8:57
Nov 13, 2012 at 12:16 history edited Adam Ryczkowski CC BY-SA 3.0
Detailed solution
Nov 13, 2012 at 10:04 comment added Tito Candelli @AdamRyczkowski I have updated the question and added informations about how the data were obtained. Thank you for your time :)
Nov 12, 2012 at 22:15 comment added Adam Ryczkowski Thank you. Indeed, I didn't know about that difficulties. The bottom line of this paper is that the end user should use ks.test from the dgof package instead of the standard one, and proceed with testing the discrete distributions, just like the problem never existed. Assuming one uses R, of course.
Nov 12, 2012 at 21:21 history edited Adam Ryczkowski CC BY-SA 3.0
added 90 characters in body
Nov 12, 2012 at 21:20 comment added whuber The KS test statistic works just fine for any distribution, but (if I recall correctly) calculation of the p-value assumes the distribution is continuous. Discrete distributions will screw it up. See the first page of journal.r-project.org/archive/2011-2/…, for instance.
Nov 12, 2012 at 21:18 comment added Adam Ryczkowski @whuibber: K-S test is about comparing cumulative distribution and I fail to see why it shouldn't apply to discrete distribution case. But maybe I'm wrong...
Nov 12, 2012 at 21:09 history edited Adam Ryczkowski CC BY-SA 3.0
Incroporated whuber's remark
Nov 12, 2012 at 21:04 comment added whuber I see now what you intended, Adam. The last paragraph is not very clear. I think you mean to say that if, in this example, you have the raw counts, then you can apply K-S to them (not to the data as presented in the question). The spirit of the idea is right--$\chi^2$ would work well--but K-S (as far as I know) does not apply to discrete distributions. It also is not at all apparent how it would be applied to count data.
Nov 12, 2012 at 20:56 comment added Adam Ryczkowski @whuber - but this is just what I've written...
Nov 12, 2012 at 20:52 comment added whuber How do you account for the number of observations? (Answer: you cannot, because they are unknown.) Until you can, no test--not K-S, not $\chi^2$--will be applicable.
Nov 12, 2012 at 19:13 history answered Adam Ryczkowski CC BY-SA 3.0