perm.test: Permutation test on the (non-)overlapping area

perm.testR Documentation

Permutation test on the (non-)overlapping area

Description

Perform a permutation test on the overlapping index.

Usage

perm.test( x, paired = FALSE, B = 1000, 
          return.distribution = FALSE, ... )

Arguments

x

a list of numerical vectors to be compared (each vector is an element of the list).

paired

logical; set to TRUE if the data are paired (i.e. non-independent samples), see details.

B

integer, number of permutation replicates.

return.distribution

logical, if TRUE it returns the distribution of permuted Z statistics.

...

options, see function overlap for details.

Details

It performs a permutation test of the null hypothesis that there is no difference between the two distributions, i.e. the overlapping index (\eta) is one, or the non-overlapping index (1-\eta = \zeta) is zero.

By default (paired = FALSE), it is assumed that the values in the list are independent observations. If the data are paired (i.e. non-independent observations; paired = TRUE), the exchange takes place within each pair. Note: if the data are paired, the elements in the list must be of the same length and in the same order.

Value

It returns a list containing the following components:

Zobs

the observed values of non-overlapping index, i.e. 1-\eta.

pval

p-values.

Zperm

the permutation distributions.

Warning

Currently, it only runs the permutation test on two groups at a time. If x contains more than 2 elements, it performs all paired permutation tests.

Note

Call function overlap.

Author(s)

Massimiliano Pastore

References

Perugini, A., Calignano, G., Nucci, M., Finos, L., & Pastore, M. (2024, December 30). How do my distributions differ? Significance testing for the Overlapping Index using Permutation Test. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.31219/osf.io/8h4fe")}

Examples

set.seed(20150605)
x <- list(X1=rnorm(100), X2=rt(50,8))

## not run: this example take several minutes
## permutation test
# out <- perm.test( x, return.distribution = TRUE )
# out$pval
# plot( density( out$Zperm ) )
# abline( v = out$Zobs ) 

x <- list(X1=rnorm(100), X2=rt(50,8), X3=rchisq(75,3))
# out <- perm.test( x )
# out$pval


overlapping documentation built on Feb. 19, 2026, 9:06 a.m.