ZceTk {nnspat} | R Documentation |
Z
-test for Cuzick and Edwards T_k
statistic
Description
An object of class "htest"
performing a z
-test for 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, Cuzick and Edwards (1990) suggested a k
-NN test T_k
based on number of cases
among k
NNs of the case points.
Under RL of n_1
cases and n_0
controls to the given locations in the study region,
T_k
approximately has N(E[T_k],Var[T_k]/n_1)
distribution for large n_1
.
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).
Thus, the z
-test for T_k
is same as the cell-specific z
-test for cell (1,1)
in the NNCT (see
cell.spec
).
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.var
(default=FALSE
) is for using the asymptotic variance or the exact (i.e., finite
sample) variance for the variance of T_k
in its standardization.
If asy.var=TRUE
, the asymptotic variance is used for Var[T_k]
(see asyvarTk
), otherwise the exact
variance (see varTk
) is used.
See also (Ceyhan (2014); Cuzick and Edwards (1990)) and the references therein.
Usage
ZceTk(
dat,
cc.lab,
k,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
case.lab = NULL,
nonzero.mat = TRUE,
asy.var = 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 |
k |
Integer specifying the number of NNs (of subject |
alternative |
Type of the alternative hypothesis in the test, one of |
conf.level |
Level of the upper and lower confidence limits, default is |
case.lab |
The label used for cases in the |
nonzero.mat |
A logical argument (default is |
asy.var |
A logical argument (default is |
... |
are for further arguments, such as |
Value
A list
with the elements
statistic |
The |
p.value |
The |
conf.int |
Confidence interval for the Cuzick and Edwards |
estimate |
Estimate of the parameter, i.e., the Cuzick and Edwards |
null.value |
Hypothesized null value for the Cuzick and Edwards |
alternative |
Type of the alternative hypothesis in the test, one of |
method |
Description of the hypothesis test |
data.name |
Name of the data set, |
Author(s)
Elvan Ceyhan
References
Ceyhan E (2014).
“Segregation indices for disease clustering.”
Statistics in Medicine, 33(10), 1662-1684.
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
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))
k<-1 #try also 2,3, sample(1:5,1)
ZceTk(Y,cls,k)
ZceTk(Y,cls,k,nonzero.mat=FALSE)
ZceTk(Y,cls,k,method="max")
ZceTk(Y,cls+1,k,case.lab = 2,alt="l")
ZceTk(Y,cls,k,asy.var=TRUE,alt="g")