2
$\begingroup$

I am investigating the achieved mark in a math test in grade 8 in two different cities. The plot shows the two Empirical Cumulative Distribution Functions (ECDF).

Plot of two ECDFs

How can I evaluate whether these two ECDFs follow the same distribution or not?

$\endgroup$
4
  • $\begingroup$ I would like to suggest you would be better off broadening your question to ask how to compare two ECDFs rather than asking whether the KS test can work, because it is clear that adapting it to these data will be problematic: both ECDFs exhibit large numbers of tied values. $\endgroup$
    – whuber
    Commented Sep 11, 2014 at 15:45
  • $\begingroup$ Oh, I am really sorry - I am not very familiar with these online platforms but I will adapt your proposal. $\endgroup$
    – Petra
    Commented Sep 11, 2014 at 15:50
  • $\begingroup$ Okay, I have changed the question in the way you suggested :) $\endgroup$
    – Petra
    Commented Sep 11, 2014 at 15:52
  • $\begingroup$ For that to be an ECDF, your sample size must be quite large. Ergo, given the large difference at low values, the two ECDFs differ. $\endgroup$
    – Glen_b
    Commented Sep 12, 2014 at 7:34

1 Answer 1

1
$\begingroup$

You can never answer for absolute certainty whether they come from the same distribution or not; we are dealing with random numbers.

However, there is a class of statistical tests of the goodness of fit between two empirical distributions, testing if the hypothesis that they come from the same distribution can be rejected or not. Examples of these tests would include the two-sample versions of the Cramer-von Mises and Anderson-Darling tests.

With just a few observations, as your graph implies, it isn't hard to run a two sample CvM test in a spreadsheet. For more data, or ease, there used to be a R package that did two-sample CvM testing. The paper is A C++ Program for the Cramer-von Mises Two-Sample Test (Xiao et al. 2006). Unfortunately, the package fell off CRAN as it didn't pass an update, Yakovlev's e-mail was dead, Gordon didn't write the program and sent me to Xiao, who said he would update the package back in April of 2014 and I haven't heard anything since.

The package itself is still in the CRAN archives if you want to install it and try.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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