Skip to main content
13 events
when toggle format what by license comment
Apr 17, 2012 at 19:02 comment added whuber No, they won't be skewed: the test accounts for this. Try it: e.g., ks.test(rnorm(10), rnorm(100)).
Apr 17, 2012 at 18:00 vote accept cosmosis
Apr 17, 2012 at 17:50 answer added Greg Snow timeline score: 4
Apr 17, 2012 at 17:46 comment added cosmosis Thanks @whuber, but won't the results be skewed if I put in 2 unbinned datasets that are not the same length? In fact, they differ by an order of magnitude in length.
Apr 17, 2012 at 17:20 comment added whuber I recognize this, @cosmo, but after you "normalized" the data they were no longer counts. Before you normalized them, the software had no clue what the bin cutpoints were. Either way, you deprived it of essential information. That helps explain why such different results can be obtained and why you shouldn't be binning at all.
Apr 17, 2012 at 17:16 comment added cosmosis @whuber, thanks for your comments. The data (dis1 and dis2) ARE the bin counts.
Apr 17, 2012 at 10:38 history edited chl CC BY-SA 3.0
edited tags; edited title
Apr 17, 2012 at 6:13 comment added whuber Cosmo, that's because your normalizing changes the locations and scales so that you have two new distributions guaranteed to be approximately alike by virtue of that normalization. But please pay attention to @Peter's comment: the KS test is designed for unbinned data and doesn't really work properly with binned data to begin with. (You don't even give it information about bin counts, which is crucial.) Do not be overly concerned with what's common in your field: it is not in the least unusual for some (apparently) common practices to be statistically inferior--or worse.
Apr 17, 2012 at 6:08 comment added cosmosis @Marius - I'm afraid I don't understand. The kstest is telling me that the distributions are both similar and not similar, depending on whether I normalize or not.
Apr 17, 2012 at 5:31 comment added Marius It seems like the kstest of the binned data is now just telling you that the two distributions have a similar shape- the means of your two original samples are still hugely discrepant, but the spread of scores around those two means is similar (in the sense that the ratio of mean1:mean2 is similar to variance1:variance2)
Apr 17, 2012 at 5:05 comment added cosmosis I'm binning the data because I want to determine if the population histograms are similar; this is rather common in my field. The data itself is not binned - dis1 and dis2 are the number of "things" within each bin.
Apr 17, 2012 at 4:51 comment added Peter Ellis Why are you binning the data? This would seem to be unnecessary indeed unhelpful. I'm not sure what software you're using but are you sure kstest2 works the way you think it does? Perhaps it's expecting the actual data, not a set of bins.
Apr 17, 2012 at 3:50 history asked cosmosis CC BY-SA 3.0