Learn R Programming

nnspat (version 0.1.2)

prob.nnct: 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;\theta)\) where \(\theta=(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 \(\theta\) 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 (ceyhan:exact-NNCT;textualnnspat) for more details.

Usage

prob.nnct(ct)

Value

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

Arguments

ct

A NNCT

Author

Elvan Ceyhan

References

See Also

exact.pval1s and exact.pval2s

Examples

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

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

Run the code above in your browser using DataLab