EV.nnct {nnspat} | R Documentation |
Expected Values of the Cell Counts in NNCT
Description
Returns a matrix
of same dimension as, ct
,
whose entries are the expected cell counts of
the NNCT under RL or CSR. The class sizes given as
the row sums of ct
and the row and column names are
inherited from ct
.
See also (Dixon (1994); Ceyhan (2010)).
Usage
EV.nnct(ct)
Arguments
ct |
A nearest neighbor contingency table |
Value
A matrix
of the expected values of cell counts in the NNCT.
Author(s)
Elvan Ceyhan
References
Ceyhan E (2010).
“On the use of nearest neighbor contingency tables for testing spatial segregation.”
Environmental and Ecological Statistics, 17(3), 247-282.
Dixon PM (1994).
“Testing spatial segregation using a nearest-neighbor contingency table.”
Ecology, 75(7), 1940-1948.
See Also
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)
EV.nnct(ct)
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
ct<-nnct(ipd,fcls)
EV.nnct(ct)
#############
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)
EV.nnct(ct)
ct<-matrix(c(0,10,5,5),ncol=2)
EV.nnct(ct)
[Package nnspat version 0.1.2 Index]