covTcomb {nnspat} | R Documentation |
Covariance matrix for T_k
values in Tcomb
Description
This function computes the covariance matrix for the T_k
values used in the T_{comb}
test statistics,
which is a linear combination of some T_k
tests.
The argument, n_1
, is the number of cases (denoted as n1
as an argument).
The number of cases is denoted as n_1
to match the case-control class labeling,
which is just the reverse of the labeling in Cuzick and Edwards (1990).
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
.
If asy.cov=TRUE
, the asymptotic covariance is used, otherwise the exact covariance is used.
See page 87 of (Cuzick and Edwards (1990)) for more details.
Usage
covTcomb(dat, n1, klist, nonzero.mat = TRUE, asy.cov = FALSE, ...)
Arguments
dat |
The data set in one or higher dimensions, each row corresponds to a data point. |
n1 |
Number of cases |
klist |
|
nonzero.mat |
A logical argument (default is |
asy.cov |
A logical argument (default is |
... |
are for further arguments, such as |
Value
Returns the covariance matrix for the T_k
values used in Tcomb
.
Author(s)
Elvan Ceyhan
References
Cuzick J, Edwards R (1990). “Spatial clustering for inhomogeneous populations (with discussion).” Journal of the Royal Statistical Society, Series B, 52, 73-104.
See Also
asycovTkTl
, covTcomb
, and Ntkl
Examples
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))
n1<-sum(cls==1)
kl<-sample(1:5,3) #try also sample(1:5,2)
kl
covTcomb(Y,n1,kl)
covTcomb(Y,n1,kl,method="max")
covTcomb(Y,n1,kl,nonzero.mat = FALSE)
covTcomb(Y,n1,kl,asy=TRUE)