Assess significance of distribution overlap. User need to specify which method to use to calculate distribution overlap. This function test whether given two samples are drawn from the same distribution or not. i.e., H0: complete overlap. Two distributions are the same. E(OVL) = 1. H1: Two distributions are different.

ovl.test(
  x1,
  x2,
  method = c("hist", "distfit", "knn", "kde"),
  nperm = 1000,
  seed = TRUE
)

Arguments

x1

A numeric vector.

x2

A numeric vector.

method

method to calculate distribution overlap

nperm

An integer. Number of permutation performed. default is 1000.

seed

A logical value. default is TRUE. set seed for reproducibility.

Value

test statistic (overlap) and permutation p-value

Author

Seongyong Park (2020-08-18)

Examples

x1 = rnorm(100, 0) x2 = rnorm(100, 1) ovl.test(x1, x2, method = "hist", nperm = 1000)
#> OVL pval #> 0.580000000 0.000999001