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
H_0:
X and Y are independent \Longleftrightarrow H_0: F(x|y=1)=F(x|Y=2)=...=F(x|Y=K)
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 \hat{\rho}(\nu)
be the sample dependnce measure based on the orginal sample indexed by \nu=\{1,2,...,n\}
. Let \pi(\nu)
denote a permutation of the elements of \nu
and the corresponding \hat{\rho}(\pi)
is computed for the permutated data on y labels.
Under the {\cal H}_0
, \hat{\rho}(\nu)
and \hat{\rho}(\pi)
are identically distributed for every permutation \pi
of \nu
.
Hence, based on M
permutations, the critical value q_{\gamma}
is estimated by the (1-\gamma)100\%
sample
quantile of \hat{\rho}(\pi_m)
, m=1,...,M
and the p-value is estimated by the proportion of
\hat{\rho}(\pi_m)
greater than \hat{\rho}(\nu)
. Usually 100\leq M\leq 1000
is sufficient for a good estimation on the critical value or p-value. The default value is M=200
.
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 )