phypers {DPQ} | R Documentation |
Compute the four (4) symmetric phyper()
calls which
mathematically would be identical but in practice typically slightl
differ numerically.
phypers(m, n, k, q = .suppHyper(m, n, k))
m |
the number of white balls in the urn. |
n |
the number of black balls in the urn. |
k |
the number of balls drawn from the urn, hence must be in 0,1,…, m+n. |
q |
vector of quantiles representing the number of white balls drawn without replacement from an urn which contains both black and white balls. The default ......... FIXME |
a list with components
q |
Description of 'comp1' |
phyp |
a numeric |
Martin Maechler
Johnson et al
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (m, n, k, q = .suppHyper(m, n, k)) { N <- m + n pm <- cbind(ph = phyper(q, m, n, k), p2 = phyper(q, k, N - k, m), Ip2 = phyper(m - 1 - q, N - k, k, m, lower.tail = FALSE), Ip1 = phyper(k - 1 - q, n, m, k, lower.tail = FALSE)) stopifnot(all.equal(pm[, 1], pm[, 2]), all.equal(pm[, 2], pm[, 3]), all.equal(pm[, 3], pm[, 4])) list(q = q, phyp = pm) }