# cov.seg.coeff: Covariance Matrix of Segregation Coefficients in a... In nnspat: Nearest Neighbor Methods for Spatial Patterns

## Description

Returns the covariance matrix of the segregation coefficients in a multi-class case based on the NNCT, ct. The covariance matrix is of dimension k(k+1)/2 \times k(k+1)/2 and its entry i,j correspond to the entries in the rows i and j of the output of ind.seg.coeff(k). The segregation coefficients in the multi-class case are the extension of Pielou's segregation coefficient for the two-class case. These covariances are valid under RL or conditional on Q and R under CSR.

The argument covN is the covariance matrix of N_{ij} (concatenated rowwise).

## Usage

 1 cov.seg.coeff(ct, covN) 

## Arguments

 ct A nearest neighbor contingency table covN The k^2 \times k^2 covariance matrix of row-wise vectorized entries of NNCT

## Value

The k(k+1)/2 x k(k+1)/2 covariance matrix of the segregation coefficients for the multi-class case based on the NNCT, ct

Elvan Ceyhan

## References

\insertAllCited

seg.coeff, var.seg.coeff, cov.nnct and cov.nnsym
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 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) cov.seg.coeff(ct,covN) #cls as a factor na<-floor(n/2); nb<-n-na fcls<-rep(c("a","b"),c(na,nb)) ct<-nnct(ipd,fcls) cov.seg.coeff(ct,covN) ############# n<-40 Y<-matrix(runif(3*n),ncol=3) cls<-sample(1:4,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10)) ipd<-ipd.mat(Y) 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) cov.seg.coeff(ct,covN)