prob.nnct: Probability of the current nearest neighbor contingency table

prob.nnctR Documentation

Probability of the current nearest neighbor contingency table

Description

Computes the probability of the observed 2 \times 2 nearest neighbor contingency table (NNCT) p_t=f(n_{11}|n_1,n_2,c_1;θ) where θ=(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. That is, given the margins of the current NNCT, the probability of obtaining the current table with the odds ratio θ being the value under the null hypothesis. This value is used to compute the table-inclusive and exclusive p-values for the exact inference on NNCTs.

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

Usage

prob.nnct(ct)

Arguments

ct

A NNCT

Value

The probability of getting the observed NNCT, ct , under the null hypothesis.

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

exact.pval1s and exact.pval2s

Examples

ct<-matrix(sample(20:40,4),ncol=2)
prob.nnct(ct)

ct<-matrix(sample(20:40,4),ncol=2)
prob.nnct(ct)


elvanceyhan/nnspat documentation built on Sept. 4, 2022, 10:28 a.m.