| perm.test | R Documentation |
Perform a permutation test on the overlapping index.
perm.test( x, paired = FALSE, B = 1000,
return.distribution = FALSE, ... )
x |
a list of numerical vectors to be compared (each vector is an element of the list). |
paired |
|
B |
integer, number of permutation replicates. |
return.distribution |
logical, if |
... |
options, see function |
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.
It returns a list containing the following components:
Zobs |
the observed values of non-overlapping index, i.e. 1- |
pval |
p-values. |
Zperm |
the permutation distributions. |
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.
Call function overlap.
Massimiliano Pastore
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")}
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.