Xsq.ceTk | R Documentation |
An object of class "Chisqtest"
performing a chi-square approximation for Cuzick and Edwards T_k test statistic
based on the number of cases within k
NNs of the cases in the data.
This approximation is suggested by \insertCitetango:2007;textualnnspat since T_k statistic had high
skewness rendering the normal approximation less efficient. The chi-square approximation is as follows:
\frac{T_k- ET_k}{√{Var T_k}} \approx \frac{χ^2_ν-ν}{√{2 ν}} where χ^2_ν is a chi-square
random variable with ν df, and ν=8/skewnees(T_k) (see SkewTk
for the skewness).
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 logical argument nonzero.mat
(default=FALSE
) is for using the A matrix if FALSE
or just the matrix of nonzero
locations in the A matrix (if TRUE
).
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 (\insertCitetango:2007;textualnnspat) and the references therein.
Xsq.ceTk( dat, cc.lab, k, 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). |
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 chi-squared test statistic for Tango's chi-square approximation to Cuzick & Edwards' T_k test for disease clustering. |
p.value |
The p-value for the hypothesis test |
df |
Degrees of freedom for the chi-squared test, which is 8/skewness where skewness is the output of
|
estimate |
Estimates, i.e., the observed T_k value. |
est.name,est.name2 |
Names of the estimates, they are almost identical for this function. |
null.value |
Hypothesized null value for Cuzick & Edwards' T_k, which is ET_k. |
method |
Description of the hypothesis test |
data.name |
Name of the data set, |
Elvan Ceyhan
ceTk
, ZceTk
and SkewTk
set.seed(123) n<-20 Y<-matrix(runif(3*n),ncol=3) cls<-sample(0:1,n,replace = TRUE) k<-sample(1:5,1) # try also 1, 3, 5, k Xsq.ceTk(Y,cls,k) Xsq.ceTk(Y,cls,k,nonzero.mat=FALSE) Xsq.ceTk(Y,cls+1,k,case.lab = 2) Xsq.ceTk(Y,cls,k,method="max") Xsq.ceTk(Y,cls,k,asy.var=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.