exact.pval2s: p-value correction to the two-sided version of exact NNCT...

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

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).

There is additional complexity in p-values for the two-sided alternatives. A recommended method is adding up probabilities of the same size and smaller than the probability associated with the current table. Alternatively, one can double the one-sided p-value (see (\insertCiteagresti:1992;textualnnspat).

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.

**Type (I):** For double the one-sided p-value, we propose the following four variants:

**Type (II):** For summing the p-values of more extreme —than that of the table— cases in both directions, the following variants are obtained. The p-value is p=∑_S f(t|n_1,n_2,c_1;θ=1) with

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

Usage

1
exact.pval2s(ptable, pval, type = "inc", double = FALSE)

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 two-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.

double

A logical argument (default is FALSE) to determine whether type I or II correction should be applied to the two-sided p-value. If TRUE type I correction (for doubling the minimum of the one-sided p-value) is applied, otherwise, type II correction (using the probabilities for the more extreme tables) is applied.

Value

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

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

exact.pval1s and tocher.cor

Examples

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

nnspat documentation built on May 10, 2021, 9:06 a.m.