Learn R Programming

hint (version 0.1-0)

hint.dist.test: To Test for Significant Distances between pairs of Intersection Sizes

Description

Tests whether the absolute distance between two intersection sizes would be expected by chance, i.e. whether they fall into opposite tails of their respective Hypergeometric Intersection distributions.

Usage

hint.dist.test(d, n1, a1, b1, n2, a2, b2, q1 = 0, q2 = 0, alternative = "greater")

Arguments

d
A positive integer specifying the observed distance to be tested.
n1
An integer specifying the number of categories in the urns for the first distribution.
a1
An integer specifying the number of balls drawn from the first urn for the first distribution.
b1
An integer specifying the number of balls drawn from the second urn for the first distribution.
n2
An integer specifying the number of categories in the urns for the second distribution.
a2
An integer specifying the number of balls drawn from the first urn for the second distribution.
b2
An integer specifying the number of balls drawn from the second urn for the second distribution.
q1
An integer specifying the number of categories with duplicates in the second urn of the first distribution. If 0 then the symmetric, singleton case is computed, otherwise the asymmetric, duplicates case is computed (see
q2
An integer specifying the number of categories with duplicates in the second urn of the second distribution. If 0 then the symmetric, singleton case is computed, otherwise the asymmetric, duplicates case is computed (see
alternative
A characer string specifying the hypothesis to be tested. Can be one of "greater", "less", or "two.sided".

Value

  • An object of class hint.test, which is a list containing the following components:
  • parametersAn integer vector giving the parameter values.
  • p.valueA numerical value giving the p-value associated with the test.
  • alternativeA character string naming the hypothesis that was tested.

Details

The distribution of absolute distances between two hypergeometric intersection sizes is given by $$P(X=d) = \sum_{{v_{1},v_{2}}_{i} \in D_{d}}^{|D_{d}|} P(v_{1_i}|n_{1},a_{1},b_{1},...)\cdot P(v_{2_i}|n_{2},a_{2},b_{2},...)$$ where $D_{d}$ is the set of pairs of intersection sizes, ${v_{1},v_{2}}$, with absolute differences of size $d$.

References

Kalinka, A.T. (2013). The probability of drawing intersections: extending the hypergeometric distribution. http://arxiv.org/abs/1305.0717{arXiv.1305.0717}

See Also

phint, hint.test, plotDistr, plot.hint.test.

Examples

Run this code
hint.dist.test(4, 20, 11, 9, 24, 14, 17, alternative = "greater")

Run the code above in your browser using DataLab