exact.pval1s {nnspat}R Documentation

p-value correction to the one-sided version of exact NNCT test

Description

In using Fisher's exact test on the 2 \times 2 nearest neighbor contingency tables (NNCTs) a correction may be needed for the p-value. For the one-sided alternatives, the probabilities of more extreme tables are summed up, including or excluding the probability of the table itself (or some middle way). Let the probability of the contingency table itself be p_t=f(n_{11}|n_1,n_2,c_1;\theta_0) where \theta_0=(n_1-1)(n_2-1)/(n_1 n_2) which is the odds ratio under RL or CSR independence and f is the probability mass function of the hypergeometric distribution. For testing the one-sided alternative H_o:\,\theta=\theta_0 versus H_a:\,\theta>\theta_0, we consider the following four methods in calculating the p-value:

See (Ceyhan (2010)) for more details.

Usage

exact.pval1s(ptable, pval, type = "inc")

Arguments

ptable

Probability of the observed 2 \times 2 NNCT under the null hypothesis using the hypergeometric distribution for Fisher's exact test.

pval

Table inclusive p-value for Fisher's exact test on the NNCT.

type

The type of the p-value correction for the one-sided exact test on the NNCT, default="inc". Takes on values "inc", "exc", "mid", "tocher" (or equivalently 1-4, respectively) for table inclusive, table-exclusive, mid-p-value, and Tocher corrected p-value, respectively.

Value

A modified p-value based on the correction specified in type.

Author(s)

Elvan Ceyhan

References

Ceyhan E (2010). “Exact Inference for Testing Spatial Patterns by Nearest Neighbor Contingency Tables.” Journal of Probability and Statistical Science, 8(1), 45-68.

See Also

exact.pval2s and tocher.cor

Examples

ct<-matrix(sample(20:40,4),ncol=2)
ptab<-prob.nnct(ct)
pv<-.3
exact.pval1s(ptab,pv)
exact.pval1s(ptab,pv,type="exc")
exact.pval1s(ptab,pv,type="mid")


[Package nnspat version 0.1.2 Index]