This function computes the asymptotic variance of Cuzick and Edwards \(T_k\) test statistic based on the number
of cases within k
NNs of the cases in the data.
The argument, \(n_1\), is the number of cases (denoted as n1
as an argument).
The number of cases are denoted as \(n_1\) and number of controls as \(n_0\) in this function
to match the case-control class labeling,
which is just the reverse of the labeling in cuzick:1990;textualnnspat.
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
) for computing \(N_s\) and \(N_t\), which are required in the computation of the
asymptotic variance. \(N_s\) and \(N_t\) are defined on page 78 of (cuzick:1990;textualnnspat) as follows.
\(N_s=\sum_i\sum_j a_{ij} a_{ji}\) (i.e., number of ordered pairs for which k
NN relation is symmetric)
and \(N_t= \sum \sum_{i \ne l}\sum a_{ij} a_{lj}\) (i.e, number of triplets \((i,j,l)\) \(i,j\), and \(l\) distinct so that
\(j\) is among k
NNs of \(i\) and \(j\) is among k
NNs of \(l\)).
For the \(A\) matrix, see the description of the functions aij.mat
and aij.nonzero
.
See (cuzick:1990;textualnnspat) for more details.