# Is there an anderson-darling goodness of fit test for two datasets?

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)


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

• 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/… . – whuber Jun 23 '11 at 16:05
• 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). – Nick Sabbe Jun 23 '11 at 19:00
• @Nick Finding or implementing a GoF test, whether in R or any other language, fits squarely within our interest in all things statistical. – whuber Jun 23 '11 at 19:13
• @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 :-) – Nick Sabbe Jun 23 '11 at 19:27
• @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. – whuber Jun 23 '11 at 20:19

Package adk was replaced by package kSamples:

Try:

install.packages("kSamples")
library(kSamples)

• the kSamples::ad.test function is rather slow. Is there a more efficient alternative? – Nemesi Apr 30 '19 at 13:04
install.packages("adk")