Pielou's Overall Test of Segregation for NNCT (for Sparse...

funsPseg.ssR Documentation

Pielou's Overall Test of Segregation for NNCT (for Sparse Sampling)


Two functions: and

Both functions are objects of class "Chisqtest" but with different arguments (see the parameter list below). Each one performs hypothesis tests of deviations of cell counts from the expected values under independence for all cells (i.e., entries) combined in the NNCT. That is, each test is Pielou's overall test of segregation based on NNCTs for k ≥ 2 classes. This overall test is based on the chi-squared approximation, is equivalent to Pearson's chi-squared test on NNCT and is due to \insertCitepielou:1961;textualnnspat. Each test is appropriate (i.e. have the appropriate asymptotic sampling distribution) when that data is obtained by sparse sampling.

Each function yields the test statistic, p-value and df which is (k-1)^2, description of the alternative with the corresponding null values (i.e. expected values) of NNCT entries, sample estimates (i.e. observed values) of the entries in NNCT. The functions also provide names of the test statistics, the method and the data set used.

The null hypothesis is that E(N_{ij})=n_i c_j /n for all entries in the NNCT where n_i is the sum of row i (i.e. size of class i), c_j is the sum of column j in the k \times k NNCT for k ≥ 2. In the output, the test statistic and the p-value are valid only for (properly) sparsely sampled data.

See also (\insertCitepielou:1961,ceyhan:eest-2010;textualnnspat) and the references therein.

Usage, yates = TRUE, sim = FALSE, Nsim = 2000), lab, yates = TRUE, sim = FALSE, Nsim = 2000, ...)



A nearest neighbor contingency table, used in only


A logical parameter (default=TRUE). If TRUE, Yates continuity correction is applied, and if FALSE the continuity correction is not applied. Equivalent to the correct argument in the base function chisq.test


A logical parameter (default=FALSE). If TRUE, p-values are computed by Monte Carlo simulation and if FALSE the p-value is based on the chi-squared approximation. Equivalent to the simulate.p.value argument in the base function chisq.test


A positive integer specifying the number of replicates used in the Monte Carlo test. Equivalent to the B argument in the base function chisq.test


The data set in one or higher dimensions, each row corresponds to a data point, used in only


The vector of class labels (numerical or categorical), used in only


are for further arguments, such as method and p, passed to the dist function. used in only


A list with the elements


The overall chi-squared statistic


Name of the test statistic


The p-value for the hypothesis test


Degrees of freedom for the chi-squared test, which is (k-1)^2 for this function. Yields NA if sim=TRUE and NSim is provided.


Estimates of the parameters, NNCT, i.e., matrix of the observed N_{ij} values which is the NNCT.,est.name2

Names of the estimates, they are identical for this function.


Matrix of hypothesized null values for the parameters which are expected values of the the N_{ij} values in the NNCT.

Name of the null values


Description of the hypothesis test

Name of the contingency table, ct, returned by only

Name of the data set, dat, returned by only


Elvan Ceyhan



See Also

overall.nnct.ct, overall.nnct, overall.seg.ct, overall.seg and chisq.test


n<-20  #or try sample(1:20,1)
cls<-sample(1:2,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))

#cls as a factor
na<-floor(n/2); nb<-n-na

cls<-sample(1:4,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
ct<-nnct(ipd,cls),cls),yates=FALSE),cls, sim = TRUE, Nsim = 2000),yates=FALSE) 

nnspat documentation built on Aug. 30, 2022, 9:06 a.m.