funsN_I_II {nnspat}R Documentation

Correction Matrices for the NNCT entries

Description

Two functions: nnct.cr1 and nnct.cr1.

Each function yields matrices which are used in obtaining the correction term to be added to the usual Chi-Square test of contingency tables (i.e., Pielou's test) applied on NNCTs to obtain types I and II overall tests. The output contingency tables are to be row-wise vectorized to obtain N_I and N_{II} vectors. See Sections 3.1 and 3.2 in (Ceyhan (2010)) or Sections 3.5.1 and 3.5.2 in (Ceyhan (2008)) for more details.

Usage

nnct.cr1(ct)

nnct.cr2(ct)

Arguments

ct

A nearest neighbor contingency table

Value

Both functions return a k \times k contingency table which is to be row-wise vectorized to obtain N_I and N_{II} vectors which are used in the correction summands to obtain types I and II overall tests from Pielou's test of segregation. See the description above for further detail.

Author(s)

Elvan Ceyhan

References

Ceyhan E (2008). “New Tests for Spatial Segregation Based on Nearest Neighbor Contingency Tables.” https://arxiv.org/abs/0808.1409v3 [stat.ME]. Technical Report # KU-EC-08-6, KoƧ University, Istanbul, Turkey.

Ceyhan E (2010). “New Tests of Spatial Segregation Based on Nearest Neighbor Contingency Tables.” Scandinavian Journal of Statistics, 37(1), 147-165.

See Also

correct.cf1 and correct.cf2

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)

#correction type 1
ct1<-nnct.cr1(ct)

#correction type 2
ct2<-nnct.cr2(ct)

ct
ct1
ct2


[Package nnspat version 0.1.2 Index]