Description Usage Arguments Value Author(s) References See Also Examples

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;θ_0)*
where *θ_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:\,θ=θ_0* versus *H_a:\,θ>θ_0*,
we consider the following four methods in calculating the *p*-value:

[(i)] with

*S=\{t:\,t ≥q n_{11}\}*, we get the*table-inclusive version*which is denoted as*p^>_{inc}*,[(ii)] with

*S=\{t:\,t> n_{11}\}*, we get the*table-exclusive version*, denoted as*p^>_{exc}*.[(iii)] Using

*p=p^>_{exc}+p_t/2*, we get the*mid-*, denoted as*p*version*p^>_{mid}*.[(iv)] We can also use

*Tocher corrected version*which is denoted as*p^>_{Toc}*(see`tocher.cor`

for details).

See (\insertCiteceyhan:exact-NNCT;textualnnspat) for more details.

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

`ptable` |
Probability of the observed |

`pval` |
Table inclusive |

`type` |
The type of the |

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

.

Elvan Ceyhan

1 2 3 4 5 6 | ```
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")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.