PermutationTest {GiniDistance} | R Documentation |
Permutation test of dependence between X and Y using (Gini) distance covariance or correlation statistics
Description
Perform permutation test using various dependence measures, in which Xs are quantitative, Y are categorical, alpha is an exponent on Euclidean distance, sigma is kernel parameter in kernel methods and return the test statistic, critical value, p-value and decision of the test.
Usage
PermutationTest(x, y, method, sigma, alpha, M = 200, level = 0.05)
Arguments
x |
data |
y |
label of data or univariate response variable |
method |
name of permutation test method and is chosen from one of the method list: dCov, dCor, KdCov, KdCor, gCov, gCor, KgCov, Kgcor |
sigma |
kernel parameter for kenerl methods |
alpha |
exponent on Euclidean distance, in (0,2), the default value = 1 |
M |
number of permutations |
level |
significance level of the test, the default value = 0.05 |
Details
X and Y are independent
PermutationTest
compute the p-value value of a permutation test of a (Gini) distance covariance or correlation statistics.
It is a self-contained R function the measure of dependence statistics.
The p-value is obtained by a permutation procedure.
Let be the sample dependnce measure based on the orginal sample indexed by
. Let
denote a permutation of the elements of
and the corresponding
is computed for the permutated data on y labels.
Under the
,
and
are identically distributed for every permutation
of
.
Hence, based on
permutations, the critical value
is estimated by the
sample
quantile of
,
and the p-value is estimated by the proportion of
greater than
. Usually
is sufficient for a good estimation on the critical value or p-value. The default value is
.
Value
PermutationTest
returns the p-value, critical value and decision of the permutation test of a specified method.
See Also
gCor
gCov
dCor
dCov
KgCov
KgCov
KdCov
Examples
n = 50
x <- runif(n)
y <- c(rep(1,n/2),rep(2,n/2))
PermutationTest(x, y, method = "gCor", alpha = 2, M = 50 )