Tcomb: Cuzick & Edwards Tcomb Test Statistic

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function computes the value of Cuzick & Edwards T_{comb} test statistic in disease clustering, where T_{comb} is a linear combination of some T_k tests.

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.

The argument klist is the vector of integers specifying the indices of the T_k values used in obtaining the T_{comb}.

The logical argument nonzero.mat (default=TRUE) is for using the A matrix if FALSE or just the matrix of nonzero locations in the A matrix (if TRUE) in the computations.

The logical argument asy.cov (default=FALSE) is for using the asymptotic covariance or the exact (i.e. finite sample) covariance for the vector of T_k values used in Tcomb in the standardization of T_{comb}. If asy.cov=TRUE, the asymptotic covariance is used, otherwise the exact covariance is used.

See page 87 of (\insertCitecuzick:1990;textualnnspat) for more details.

Usage

1
2
3
4
5
6
7
8
9
Tcomb(
  dat,
  cc.lab,
  klist,
  case.lab = NULL,
  nonzero.mat = TRUE,
  asy.cov = FALSE,
  ...
)

Arguments

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

klist

list of integers specifying the indices of the T_k values used in obtaining the T_{comb}.

case.lab

The label used for cases in the cc.lab (if cc.lab is not provided then the labels are converted such that cases are 1 and controls are 0), default is NULL.

nonzero.mat

A logical argument (default is TRUE) to determine whether the A matrix or the matrix of nonzero locations of the A matrix will be used in the computation of N_s and N_t. If TRUE the nonzero location matrix is used, otherwise the A matrix itself is used.

asy.cov

A logical argument (default is FALSE) to determine whether asymptotic or exact (i.e., finite sample) covariances between T_k and T_l values are to be used to obtain the entries of the covariance matrix. If TRUE the asymptotic covariance values are used, otherwise exact covariance values are used.

...

are for further arguments, such as method and p, passed to the dist function.

Value

Returns the value of the T_{comb} test statistic

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

ceTk, EV.Tcomb, and ZTcomb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
n<-20  #or try sample(1:20,1) #try also n<-50, 100
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE)  #or try cls<-rep(0:1,c(10,10))
n1<-sum(cls==1)

kl<-sample(1:5,3) #try also sample(1:5,2)
kl
Tcomb(Y,cls,kl)
Tcomb(Y,cls,kl,method="max")
Tcomb(Y,cls+1,kl,case.lab=2)
Tcomb(Y,cls,kl,nonzero.mat = FALSE)
Tcomb(Y,cls,kl,asy.cov = TRUE)

#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
Tcomb(Y,fcls,kl,case.lab="a")

nnspat documentation built on May 10, 2021, 9:06 a.m.