Tutorial R
Terdapat empat fungsi untuk menangani distribusi hipergeometrik dalam pemrograman R yakni: dhyper(), phyper(), qhyper(), dan rhyper().
Distribusi hipergeometrik, sama sepertinya halnya distribusi binomial, terdiri dari dua hasil yang mungkin yakni sukses dan gagal. Distribusi hipergeometrik hanya berlaku untuk percobaan di mana uji coba dilakukan tanpa pengembalian (without replacement).
Distribusi peluang peubah acak hipergeometrik \(X\), yaitu banyaknya sukses dalam sampel acak ukuran \(n\) yang diambil dari \(N\) benda yang mengandung \(k\) bernama sukses dan \(N-k\) bernama gagal, ialah
Terdapat empat fungsi untuk menangani distribusi hipergeometrik dalam pemrograman R yakni: dhyper()
, phyper()
, qhyper()
, dan rhyper()
.
dhyper(x, m, n, k, log = FALSE)
phyper(q, m, n, k, lower.tail = TRUE, log.p = FALSE)
qhyper(p, m, n, k, lower.tail = TRUE, log.p = FALSE)
rhyper(nn, m, n, k)
x, q | vector of quantiles representing the number of white balls drawn without replacement from an urn which contains both black and white balls. |
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. |
p | probability, it must be between 0 and 1. |
nn | number of observations. If length(nn) > 1, the length is taken to be the number required. |
log, log.p | logical; if TRUE, probabilities p are given as log(p). |
lower.tail | logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x]. |
Do not fear the winds of adversity. Remember, a kite rises against the wind rather than with it.
Unknown