funsZcell.nnct.pval {nnspat}R Documentation

p-values for Cell-specific Z Test Statistics for NNCT

Description

Four functions: Zcell.nnct.2s, Zcell.nnct.rs, Zcell.nnct.ls and Zcell.nnct.pval.

These functions yield a contingency table (i.e., a matrix) of the p-values for the cell-specific Z test statistics for the NNCT and take the cell-specific Z test statistics in matrix form as their argument. Zcell.nnct.pval yields an array of size k \times k \times 3 where 1st entry of the array is the matrix of p-values for the two-sided alternative, 2nd entry of the array is the matrix of p-values for the left-sided alternative and 3rd entry of the array is the matrix of p-values for the right-sided alternative. And each of Zcell.nnct.2s, Zcell.nnct.rs and Zcell.nnct.ls yield a k \times k matrix of p-values for the two-sided, right-sided and left-sided alternative, respectively.

The functions Zcell.nnct.2s, Zcell.nnct.rs and Zcell.nnct.ls are equivalent to Zcell.nnct(...,alt)$p.val where alt="two-sided", "greater" and "less", respectively, with the appropriate arguments for the function Zcell.nnct (see the examples below).

See also (Dixon (1994, 2002); Ceyhan (2010)).

Usage

Zcell.nnct.pval(zt)

Zcell.nnct.2s(zt)

Zcell.nnct.ls(zt)

Zcell.nnct.rs(zt)

Arguments

zt

A k \times k matrix of the cell-specific Z test statistics

Value

Zcell.nnct.pval returns a k \times k \times 3 array whose 1st entry is the matrix of p-values for the two-sided alternative, 2nd entry is the matrix of p-values for the left-sided alternative and 3rd entry is the matrix of p-values for the right-sided alternative Zcell.nnct.2s returns a k \times k matrix of p-values for the two-sided alternative Zcell.nnct.rs returns a k \times k matrix of p-values for the right-sided alternative Zcell.nnct.ls returns a k \times k matrix of p-values for the left-sided alternative

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.

Dixon PM (2002). “Nearest-neighbor contingency table analysis of spatial segregation for several species.” Ecoscience, 9(2), 142-151.

See Also

Zcell.nnct and Zcell.nnct.ct

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:2,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
TS<-Zcell.nnct(Y,cls)$statistic
TS
pv<-Zcell.nnct.pval(TS)
pv

Zcell.nnct(Y,cls,alt="t")$p.val
Zcell.nnct(Y,cls,alt="l")$p.val
Zcell.nnct(Y,cls,alt="g")$p.val

Zcell.nnct.2s(TS)

Zcell.nnct.ls(TS)

Zcell.nnct.rs(TS)


[Package nnspat version 0.1.2 Index]