Learn R Programming

hint (version 0.1-0)

hint-package: The hint package

Description

Tools for hypothesis testing based on Hypergeometric Intersection distributions.

Arguments

Details

Hypergeometric Intersection distributions are a broad group of distributions that describe the probability of picking intersections when drawing independently from two (or more) urns containing variable numbers of balls belonging to the same n categories.

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

Hyperintersection, hint.test, Hyperdistinct.

Examples

Run this code
## Generate a hypergeometric intersection distribution and plot it.
dd <- dhint(110, 65, 71)
plotDistr(dd)

## Allow duplicates in q of the categories in the second urn and add the distributions to the existing plot.
dd <- dhint(110, 65, 71, 82)
dd2 <- dhint(59, 44, 28, 47)
add.distr(dd, dd2, cols = c("blue", "darkgreen"))

## Test whether the intersection of categories in data sets is significant and plot the result:
dd <- data.frame(letters[1:20], rep(1,20), rep(1,20))
tt <- hint.test(dd, letters[1:9], letters[4:15], alternative = "greater")
plot(tt)

## Allow duplicates in the second urn.
dd <- data.frame(letters[1:20], rep(1,20), c(rep(1,4),rep(2,16)))
tt <- hint.test(dd, letters[1:9], letters[9:14], alternative = "less")
plot(tt)

Run the code above in your browser using DataLab