SkewTk | R Documentation |
T_k
Test statisticThis 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-\mu)^3/(E(T-\mu)^2)^{1.5}
where \mu=E T
.
Skewness is used for Tango's correction to Cuzick and Edwards k
NN 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.
SkewTk(n1, k, a)
n1 |
Number of cases |
k |
Integer specifying the number of NNs (of subject |
a |
|
The skewness of Cuzick and Edwards T_k
test statistic for disease clustering
Elvan Ceyhan
ceTk
, EV.Tk
, and varTk
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.