SkewTk: Skewness of Cuzick and Edwards T_k Test statistic

SkewTkR Documentation

Skewness of Cuzick and Edwards T_k Test statistic

Description

This function estimates the skewness of Cuzick and Edwards T_k test statistic under the RL hypothesis. Skewness of a random variable T is defined as E(T-μ)^3/(E(T-μ)^2)^{1.5} where μ=E T.

Skewness is used for Tango's correction to Cuzick and Edwards kNN test statistic, T_k. Tango's correction is a chi-square approximation, and its degrees of freedom is estimated using the skewness estimate (see page 121 of \insertCitetango:2007;textualnnspat).

The argument, n_1, is the number of cases (denoted as n1 as an argument) and k is the number of NNs considered in T_k test statistic. The argument of the function is the A_{ij} matrix, a, which is the output of the function aij.mat. However, inside the function we symmetrize the matrix a as b <- (a+a^t)/2, to facilitate the formulation.

The number of cases are denoted as n_1 and number of controls as n_0 in this function to match the case-control class labeling, which is just the reverse of the labeling in \insertCitecuzick:1990;textualnnspat.

Usage

SkewTk(n1, k, a)

Arguments

n1

Number of cases

k

Integer specifying the number of NNs (of subject i)

a

A_{ij} matrix which is the output of the function aij.mat.

Value

The skewness of Cuzick and Edwards T_k test statistic for disease clustering

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

ceTk, EV.Tk, and varTk

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE)
n1<-sum(cls==1)

k<-sample(1:5,1) # try also 3, 5, sample(1:5,1)
k
a<-aij.mat(Y,k)

SkewTk(n1,k,a)


nnspat documentation built on Aug. 30, 2022, 9:06 a.m.