Learn R Programming

nnspat (version 0.1.2)

Nt.def: \(N_t\) Value (found with the definition formula)

Description

This function computes the \(N_t\) value which is required in the computation of the asymptotic variance of Cuzick and Edwards \(T_k\) test. Nt is defined on page 78 of (cuzick:1990;textualnnspat) as follows. \(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\)).

This function yields the same result as the asyvarTk and varTk functions with $Nt inserted at the end.

See (cuzick:1990;textualnnspat) for more details.

Usage

Nt.def(a)

Value

Returns the \(N_t\) value standing for the 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\). See the description.

Arguments

a

The \(A=(a_{ij})\) matrix. The argument a is the \(A\) matrix, obtained as output fromm aij.mat.

Author

Elvan Ceyhan

References

See Also

asyvarTk, varTk, and varTkaij

Examples

Run this code
n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
k<-2 #try also 2,3
a<-aij.mat(Y,k)
Nt.def(a)

Run the code above in your browser using DataLab