permTest {ccaPP} | R Documentation |
(Robust) permutation test for no association
Description
Test whether or not there is association betwenn two data sets, with a focus on robust and nonparametric correlation measures.
Usage
permTest(x, y, R = 1000, fun = maxCorGrid, permutations = NULL,
nCores = 1, cl = NULL, seed = NULL, ...)
Arguments
x , y |
each can be a numeric vector, matrix or data frame. |
R |
an integer giving the number of random permutations to be used. |
fun |
a function to compute a maximum correlation measure between
two data sets, e.g., |
permutations |
an integer matrix in which each column contains the
indices of a permutation. If supplied, this is preferred over |
nCores |
a positive integer giving the number of processor cores to be
used for parallel computing (the default is 1 for no parallelization). If
this is set to |
cl |
a parallel cluster for parallel computing as generated by
|
seed |
optional integer giving the initial seed for the random number
generator (see |
... |
additional arguments to be passed to |
Details
The test generates R
data sets by randomly permuting the observations
of x
, while keeping the observations of y
fixed. In each
replication, a function to compute a maximum correlation measure is
applied to the permuted data sets. The p
-value of the test is then
given by the percentage of replicates of the maximum correlation measure
that are larger than the maximum correlation measure computed from the
original data.
Value
An object of class "permTest"
with the following components:
pValue |
the |
cor0 |
the value of the test statistic. |
cor |
the values of the test statistic for each of the permutated data sets. |
R |
the number of random permutations. |
seed |
the seed of the random number generator. |
call |
the matched function call. |
Author(s)
Andreas Alfons
References
A. Alfons, C. Croux and P. Filzmoser (2016) Robust maximum association between data sets: The R Package ccaPP. Austrian Journal of Statistics, 45(1), 71–79.
See Also
Examples
data("diabetes")
x <- diabetes$x
y <- diabetes$y
## Spearman correlation
permTest(x, y, R = 100, method = "spearman")
permTest(x, y, R = 100, method = "spearman", consistent = TRUE)
## Pearson correlation
permTest(x, y, R = 100, method = "pearson")