var.nnsym {nnspat}R Documentation

Variances of Differences of Off-Diagonal Entries in an NNCT

Description

Returns the variances of differences of off-diagonal cell counts N_{ij}-N_{ji} for i,j=1,\ldots,k and i \ne j in the NNCT, ct in a vector of length k(k-1)/2, the order of i,j for N_{ij}-N_{ji} is as in the output of ind.nnsym(k). These variances are valid under RL or conditional on Q and R under CSR.

See also (Dixon (1994); Ceyhan (2014)).

Usage

var.nnsym(covN)

Arguments

covN

The k^2 \times k^2 covariance matrix of row-wise vectorized entries of NNCT

Value

A vector of length k(k-1)/2, whose entries are the variances of differences of off-diagonal cell counts N_{ij}-N_{ji} for i,j=1,\ldots,k and i \ne j in the NNCT.

Author(s)

Elvan Ceyhan

References

Ceyhan E (2014). “Testing Spatial Symmetry Using Contingency Tables Based on Nearest Neighbor Relations.” The Scientific World Journal, Volume 2014, Article ID 698296.

Dixon PM (1994). “Testing spatial segregation using a nearest-neighbor contingency table.” Ecology, 75(7), 1940-1948.

See Also

var.nnct, var.tct and cov.nnct

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
cls<-sample(1:2,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
ct<-nnct(ipd,cls)

W<-Wmat(ipd)
Qv<-Qvec(W)$q
Rv<-Rval(W)
varN<-var.nnct(ct,Qv,Rv)
covN<-cov.nnct(ct,varN,Qv,Rv) #default is byrow

var.nnsym(covN)

#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
cls<-sample(1:4,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
ct<-nnct(ipd,cls)

W<-Wmat(ipd)
Qv<-Qvec(W)$q
Rv<-Rval(W)
varN<-var.nnct(ct,Qv,Rv)
covN<-cov.nnct(ct,varN,Qv,Rv)

var.nnsym(covN)


[Package nnspat version 0.1.2 Index]