s-news
[Top] [All Lists]

hypergeometric distribution

To: <s-news@lists.biostat.wustl.edu>
Subject: hypergeometric distribution
From: "Manuel Voelkle" <manu.voelkle@gmx.de>
Date: Thu, 27 Jan 2005 22:35:43 +0100
Hi,
please excuse this obviously trivial question, but I am new to Splus and
could not find a solution in the archives:

I want to draw 10 balls out of an urn containing 5 black and 5 white balls
without replacement. Since this should be a hypergeometric distribution I am
using

rhyper(nn, m, n, k)

to simulate this example.
For nn <- 1, the result must be 5 of course, however, I am NOT interested in
the total amount of  black balls drawn from the urn but rather in the
outcome of every single drawing (i.e. a 10*1 vector with 5 zeros and 5 ones
for example).

Thank you very much for your help!

Manuel


<Prev in Thread] Current Thread [Next in Thread>