Ntkl {nnspat}R Documentation

N_{tkl} Value

Description

This function computes the N_{tkl} value which is required in the computation of the exact and asymptotic variance of Cuzick and Edwards T_{comb} test, which is a linear combination of some T_k tests. N_{tkl} is defined on page 80 of (Cuzick and Edwards (1990)) as follows. Let a_{ij}(k) be 1 if j is a k NN of i and zero otherwise and N_t(k,l) = \sum \sum_{i \ne m}\sum a_{ij}(k) a_{mj}(l).

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.

See (Cuzick and Edwards (1990)) for more details.

Usage

Ntkl(dat, k, l, nonzero.mat = TRUE, ...)

Arguments

dat

The data set in one or higher dimensions, each row corresponds to a data point.

k, l

Integers specifying the number of NNs (of subjects i and m in a_{ij}(k) a_{mj}(l)).

nonzero.mat

A logical argument (default is TRUE) to determine whether the A matrix or the matrix of nonzero locations of the A matrix will be used in the computation of N_s and N_t (argument is passed on to asycovTkTl and covTkTl). If TRUE the nonzero location matrix is used, otherwise the A matrix itself is used.

...

are for further arguments, such as method and p, passed to the dist function.

Value

Returns the N_{tkl} value. See the description.

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, and covTkTl

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
k<-1 #try also 2,3 or sample(1:5,1)
l<-1 #try also 2,3 or sample(1:5,1)
c(k,l)

Ntkl(Y,k,l)
Ntkl(Y,k,l,nonzero.mat = FALSE)
Ntkl(Y,k,l,method="max")


[Package nnspat version 0.1.2 Index]