prob.nnct {nnspat} | R 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;\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 (2010)) 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
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
Examples
ct<-matrix(sample(20:40,4),ncol=2)
prob.nnct(ct)
ct<-matrix(sample(20:40,4),ncol=2)
prob.nnct(ct)