10
$\begingroup$

I know ad.test() can be used for testing normality.

Is it possible to get ad.test to compare the distributions from two data samples?

x <- rnorm(1000)
y <- rgev(2000)
ad.test(x,y)

How can I perform the Anderson-Darling test on 2 samples?

$\endgroup$
  • 2
    $\begingroup$ The Wikipedia article on the A-D test mentions this under the heading "Non-parametric k-sample tests." Its reference, a 1987 JASA paper by Sholz and Stephens, is freely available at cithep.caltech.edu/~fcp/statistics/hypothesisTest/… . $\endgroup$ – whuber Jun 23 '11 at 16:05
  • $\begingroup$ If the question is: how can I do it in R (as the tag suggests): good question (+1) (and the answer is probably: rig it yourself), albeit somewhat misplaced here (StackOverflow is a better place for this kind of question). $\endgroup$ – Nick Sabbe Jun 23 '11 at 19:00
  • $\begingroup$ @Nick Finding or implementing a GoF test, whether in R or any other language, fits squarely within our interest in all things statistical. $\endgroup$ – whuber Jun 23 '11 at 19:13
  • 1
    $\begingroup$ @whuber: I stand corrected: I just read the relevant part of the faq. Still, it's a thin line between love and hate. But I didn't vote to migrate :-) $\endgroup$ – Nick Sabbe Jun 23 '11 at 19:27
  • 2
    $\begingroup$ @Nick I agree about the thin line. When a question focuses purely on the mechanics of programming, its appropriateness here becomes doubtful. You can find periodic discussions about this on meta. $\endgroup$ – whuber Jun 23 '11 at 20:19
7
$\begingroup$

Package adk was replaced by package kSamples:

Try:

install.packages("kSamples")  
library(kSamples)
ad.test(runif(50), rnorm(30))
$\endgroup$
  • $\begingroup$ the kSamples::ad.test function is rather slow. Is there a more efficient alternative? $\endgroup$ – Nemesi Apr 30 '19 at 13:04
5
$\begingroup$

The adk package for R does this. http://cran.r-project.org/web/packages/adk/

install.packages("adk")
library(adk)
adk.test(runif(50), rnorm(30))
$\endgroup$
  • 2
    $\begingroup$ The adk package was removed from CRAN. Is there an alternative ? $\endgroup$ – JE42 Jun 10 '14 at 20:10

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.