funsW345values {nnspat}R Documentation

W_k values for Tango's T test statistic

Description

Three functions: W3val, W4val and W5val, each of which is needed to compute E[T^3] (i.e., for the skewness of T) where T=T(\theta) which is defined in Equation (2) of Tango (2007) as follows: Let (z_1,\ldots,z_n ), n = n_0 + n_1, denote the locations of the points in the combined sample when the indices have been randomly permuted so that the z_i contain no information about group membership.

T(\theta)=\sum_{i=1}^{n}\sum_{j=1}^{n}\delta_i \delta_j a_{ij}(\theta)= \boldsymbol \delta^t \boldsymbol A(\theta)) \boldsymbol \delta

where \delta_i=1 if z_i is a case, and 0 if z_i is a control, \boldsymbol A(\theta) = (a_{ij} (\theta)) could be any matrix of a measure of the closeness between two points i and j with a_{ii} = 0 for all i = 1,\ldots,n, and \boldsymbol \theta = (\theta_1,\ldots,\theta_p)^t denotes the unknown parameter vector related to cluster size and \boldsymbol \delta = (\delta_1,\ldots,\delta_n)^t. Here the number of cases are denoted as n_1 and number of controls as n_0 to match the case-control class labeling, which is just the reverse of the labeling in Tango (2007).

If \theta=k in the nearest neighbors model with a_{ij}(k) = 1 if z_j is among the kNNs of z_i and 0 otherwise, then the test statistic T(\theta) = T_k is the Cuzick and Edwards kNN test statistic, T_k Cuzick and Edwards (1990), see also ceTk.

W_k values are used for Tango's correction to Cuzick and Edwards kNN test statistic, T_k and W_k here corresponds to W_{k-1} in Tango (2007) (defined for consistency with p_k's and alpha_r having r distinct elements).

The argument of the function is the A_{ij} matrix, a, which is the output of the function aij.mat. However, inside the function we symmetrize the matrix a as b <- (a+a^t)/2, to facilitate the formulation.

Usage

W3val(a)

W4val(a)

W5val(a)

Arguments

a

A_{ij} matrix which is the output of the function aij.mat.

Value

Each function Wkval returns the W_k value for k=3,4,5.

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.

Tango T (2007). “A class of multiplicity adjusted tests for spatial clustering based on case-control point data.” Biometrics, 63, 119-127.

See Also

ceTk, EV.Tk, varTk, Xsq.ceTk

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
k<-sample(1:5,1) # try also 3, 5, sample(1:5,1)
k
a<-aij.mat(Y,k)
W3val(a)
W4val(a)
W5val(a)

a<-aij.mat(Y,k,method="max")
W3val(a)
W4val(a)
W5val(a)


[Package nnspat version 0.1.2 Index]