EV.tct {nnspat} | R Documentation |
Expected Values of the Types I-IV cell-specific tests
Description
Returns a matrix
of same dimension as, ct
,
whose entries are the expected values
of the T_{ij}
values which are the Types I-IV cell-specific
test statistics (i.e., T^I_{ij}-T^{IV}_{ij}
)
under RL or CSR.
The row and column names are inherited from ct
.
The type argument specifies the type
of the cell-specific test among the types I-IV tests.
See also (Ceyhan (2017)) and the references therein.
Usage
EV.tct(ct, type = "III")
Arguments
ct |
A nearest neighbor contingency table |
type |
The type of the cell-specific test, default= |
Value
A matrix
of the expected values of
Type I-IV cell-specific tests.
Author(s)
Elvan Ceyhan
References
Ceyhan E (2017). “Cell-Specific and Post-hoc Spatial Clustering Tests Based on Nearest Neighbor Contingency Tables.” Journal of the Korean Statistical Society, 46(2), 219-245.
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.tct(ct,2)
EV.tct(ct,"II")
EV.tctI(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.tct(ct,2)
#############
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.tct(ct,2)
ct<-matrix(c(0,10,5,5),ncol=2)
EV.tct(ct,2)