Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ad.test

Anderson-Darling GoF test


Description

Implementation of the Anderson-Darling goodness of fit test.

Usage

ad.test(x, distr.fun, ...)

Arguments

x

a random sample from a possibly unknown continuous distribution

distr.fun

a named CDF, such as pnorm, punif, etc.

...

extra parameters for the distribution function above, such as location and scale parameters, etc.

Details

If the distr.fun is provided, the function checks whether x is a iid sample from the distribution described by such CDF. Otherwise, whether they follow a uniform law.

Value

The output is an object of the class htest exactly like for the Kolmogorov-Smirnov test, ks.test. The statistic and p.value fields are the most relevant ones.

Author(s)

Carlos J. Gil Bellosta

References

G. and J. Marsaglia, "Evaluating the Anderson-Darling Distribution", Journal of Statistical Software, 2004

Examples

set.seed( 123 )
    x <- runif( 100 )

    ad.test( x )$p.value

    ad.test( x, pnorm, 0, 1 )$p.value

    replicate( ad.test( rnorm( 100 ), pnorm )$p.value, 100 )

ADGofTest

Anderson-Darling GoF test

v0.3
GPL
Authors
Carlos J. Gil Bellosta
Initial release
2011-12-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.