Learn R Programming

overlapping (version 2.5)

perm.test: 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, ... )

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.

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.

Author

Massimiliano Pastore

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.

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.

References

Calignano, G., Perugini, A., Nucci, M., Finos, L., Pastore M. (2026). How do my distributions differ? Significance testing for the Overlapping Index using Permutation Test. Psychonomic Bulletin & Review, 33:189. tools:::Rd_expr_doi("https://doi.org/10.3758/s13423-026-02946-z")

Examples

Run this code
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

Run the code above in your browser using DataLab