Skip to contents

Source: Hedderich, Sachs and Reynarowych, Applied Statistics: Methods Using R, section 7.2.8, equation (7.33), citing Anderson and Darling (1952) and Stephens (1986b). The corpus text layer renders (7.33) with two extraction defects, corrected here against the surrounding prose and Anderson and Darling (1952): the trailing "n sigma 2" is spillover from the neighbouring column and is not part of the statistic, and "1 - Y_{N+1-i}" is "1 - F(Y_{N+1-i})". What is computed is the standard published form A2 = -N - (1/N) sum_i (2i-1) (log u_i + log(1 - u_{N+1-i})) with u_i the sorted probability-integral transforms.

Usage

Adstat(y, cdf)

Arguments

y

Numeric sample.

cdf

Function giving the hypothesised distribution function, applied to one value at a time. It must be fully specified.

Value

list: statistic, u, n, method.

Details

The book notes critical values must be derived separately for each distribution model, so no p-value is returned.

Examples

Adstat(qnorm(seq(0.05, 0.95, length.out = 20)), pnorm)$statistic
#> [1] 0.1037237