# CriticalValue: Find a critical value by permutation test of dependence... In GiniDistance: A New Gini Correlation Between Quantitative and Qualitative Variables

## Description

Find a critical value by permutation test using variance of kernel (Gini) distance covariance or correlation statistics, in which Xs are quantitative, Y are categorical, sigma is kernel standard deviation, alpha is an exponent on Euclidean distance and returns the critical value of the measures of dependence.

## Usage

 1  CriticalValue(x, y, sigma, alpha, level, M = 1000, method) 

## Arguments

 x data y label of data or univariate response variable sigma kernel standard deviation alpha exponent on Euclidean distance, in (0,2] level significance level of the test, the default value = 0.05 M number of permutations method string name of the method for permutation test, e.g. gCov

## Details

CriticalValue compute the critical value of a dependence test of a kernel (Gini) distance covariance or correlation statistics. It is a self-contained R function returning the critical value of the measure of dependence statistics.

The critical value of the test of significance level γ, however, is obtained by a permutation procedure. Let ν = 1: n be the vector of original sample indices of the sample for Y labels and \hat{ρ}_g(α) = \hat{ρ}(ν;α). Let π(ν) denote a permutation of the elements of ν and the corresponding \hat{ρ}_g(π;α) is computed. Under the {\cal H}_0, \hat{ρ}_g(ν) and \hat{ρ}_g(π;α) are identically distributed for every permutation π of ν. Hence, based on M permutations, the critical value q_{γ} is estimated by the (1-γ)100\% sample quantile of \hat{ρ}_g(π_m;α), m=1,...,M. Usually 100≤q M≤q 1000 is sufficient for a good estimation on the critical value.

See PermutationTest for a test of multivariate independence based on the (Gini) distance statistic.

## Value

CriticalValue returns return the critical value of the measures of the dependence of the permutation test of a specified function

PermutationTest
 1 2 3 4  n = 50 x <- runif(n) y <- c(rep(1,n/2),rep(2,n/2)) CriticalValue(x, y, sigma=1, alpha=2, level=0.04, M = 1000, method='KgCov')