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

H0:H_0: X and Y are independent H0:F(xy=1)=F(xY=2)=...=F(xY=K)\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 ν={1,2,...,n}\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 H0{\cal H}_0, ρ^(ν)\hat{\rho}(\nu) and ρ^(π)\hat{\rho}(\pi) are identically distributed for every permutation π\pi of ν\nu. Hence, based on MM permutations, the critical value qγq_{\gamma} is estimated by the (1γ)100%(1-\gamma)100\% sample quantile of ρ^(πm)\hat{\rho}(\pi_m), m=1,...,Mm=1,...,M and the p-value is estimated by the proportion of ρ^(πm)\hat{\rho}(\pi_m) greater than ρ^(ν)\hat{\rho}(\nu). Usually 100M1000100\leq M\leq 1000 is sufficient for a good estimation on the critical value or p-value. The default value is M=200M=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 )

[Package GiniDistance version 0.1.1 Index]