ZceTk | R Documentation |
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, \insertCitecuzick:1990;textualnnspat 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 (\insertCiteceyhan:SiM-seg-ind2014,cuzick:1990;textualnnspat) and the references therein.
ZceTk( dat, cc.lab, k, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, case.lab = NULL, nonzero.mat = TRUE, asy.var = FALSE, ... )
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 i). |
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 |
A list
with the elements
statistic |
The Z test statistic for the Cuzick and Edwards T_k test |
p.value |
The p-value for the hypothesis test for the corresponding alternative |
conf.int |
Confidence interval for the Cuzick and Edwards T_k value
at the given confidence level |
estimate |
Estimate of the parameter, i.e., the Cuzick and Edwards T_k value. |
null.value |
Hypothesized null value for the Cuzick and Edwards T_k value which is k n_1 (n_1-1)/(n-1) for this function. |
alternative |
Type of the alternative hypothesis in the test, one of |
method |
Description of the hypothesis test |
data.name |
Name of the data set, |
Elvan Ceyhan
ceTk
, cell.spec
, and Xsq.ceTk
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.