ceTk | R Documentation |
T_k
Test statisticThis function computes Cuzick and Edwards T_k
test statistic based on the number of cases within k
NNs of the cases
in the data.
For disease clustering, \insertCitecuzick:1990;textualnnspat suggested a k
-NN test based on number of cases
among k
NNs of the case points.
Let z_i
be the i^{th}
point and d_i^k
be the number cases among k
NNs of z_i
.
Then Cuzick-Edwards' k
-NN test is T_k=\sum_{i=1}^n \delta_i d_i^k
, where \delta_i=1
if z_i
is a case, and 0 if z_i
is a control.
The argument cc.lab
is case-control label, 1 for case, 0 for control, if the argument case.lab
is NULL
,
then cc.lab
should be provided in this fashion, if case.lab
is provided, the labels are converted to 0's
and 1's accordingly.
Also, T_1
is identical to the count for cell (1,1)
in the nearest neighbor contingency table (NNCT)
(See the function nnct
for more detail on NNCTs).
See also (\insertCiteceyhan:SiM-seg-ind2014,cuzick:1990;textualnnspat) and the references therein.
ceTk(dat, cc.lab, k = 1, case.lab = NULL, ...)
dat |
The data set in one or higher dimensions, each row corresponds to a data point. |
cc.lab |
Case-control labels, 1 for case, 0 for control |
k |
Integer specifying the number of NNs (of subject |
case.lab |
The label used for cases in the |
... |
are for further arguments, such as |
Cuzick and Edwards T_k
test statistic for disease clustering
Elvan Ceyhan
Tcomb
, seg.ind
, Pseg.coeff
and ceTkinv
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE) #or try cls<-rep(0:1,c(10,10))
ceTk(Y,cls)
ceTk(Y,cls,method="max")
ceTk(Y,cls,k=3)
ceTk(Y,cls+1,case.lab = 2)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ceTk(Y,fcls,case.lab="a") #try also ceTk(Y,fcls)
#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:4,n,replace = TRUE) # here ceTk(Y,cls) gives an error message
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.