AndersonDarling: K-Sample Anderson Darling Test

Description Usage Arguments Details Value Note Author(s) References Examples

Description

This is a non-parametric K-sample test that tests equality of distribution of a variable between k populations based on samples from each of the populations.

Usage

1
AndersonDarling(data, number.cases)

Arguments

data

A single vector consisting of concatenation of the k samples data being used for the test

number.cases

A vector consisting of the number of cases in samples 1, 2, ..., k, respectively

Details

The data is a vector including all the k samples to be used for the test. The j-th element of number.cases is the number of cases in sample j (included in data), for j= 1,...,k.

Value

pn

The test's p-value.

adk.all

The Anderson Darling test statistic corresponding to each group.

adl

The sum of elements of adk.all.

var.sdk

The variance of the finite sample distribution of the Anderson Darling test statistic under the null.

Note

The test does not adjust for tie observations.

Author(s)

Mortaza Jamshidian, Siavash Jalal, and Camden Jansen

References

Scholz, F.W. and Stephens, M.A. (1987). ”K-Sample Anderson-Darling Tests,” Journal of the American Statistical Association, 82, 918-924.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#---- Example 1
set.seed(50)
n1 <- 30
n2 <- 45
n3 <- 60
v1 <- rnorm(n1)
v2 <- runif(n2)
v3 <- rnorm(n3, 2, 3)
AndersonDarling(data = c(v1, v2, v3), number.cases=c(n1, n2, n3))

#---- Example 2
set.seed(50)
n1 <- 30
n2 <- 45
n3 <- 60
v1 <- rt(n1,4)
v2 <- rt(n2,4)
v3 <- rt(n3,4)
AndersonDarling(data=c(v1, v2, v3), number.cases=c(n1, n2, n3))

Example output

$pn
[1] 1.345932e-31

$adk.all
         [,1]
[1,] 6.566425
[2,] 5.075349
[3,] 6.978307

$adk
[1] 18.62008

$var.sdk
[1] 1.119502

$pn
[1] 0.3878912

$adk.all
          [,1]
[1,] 0.6364330
[2,] 0.7773931
[3,] 0.5886475

$adk
[1] 2.002474

$var.sdk
[1] 1.119502

MissMech documentation built on May 2, 2019, 1:08 p.m.