Re: [R] Negative Binomial: Simulation

From: Hadassa Brunschwig <>
Date: Fri 14 Jul 2006 - 23:18:34 EST

Addition to last email:

The problem basically arises also when I want to calculate (plot) the cumulative distribution of the negative binomial with the calculated parameters mu and theta!

On 7/14/06, Hadassa Brunschwig <> wrote:
> Hi R-Users!
> (sorry about the last email)
> I fitted a negative binomial distribution to my count data using the
> function glm.nb() and obtained the calculated parameters
> theta (dispersion) and mu.
> I would like to simulate values from this negative binomial distribution.
> Looking at the function rnbinom() I was looking at the relationship
> between the two possible parametrizations of the negative binomial and found
> that for this fuction I must use:
> prob = theta/(theta+mu) and size = theta
> Theta, however, is not an integer. So how can size (which is the number of
> successes) equal theta?
> I know there is a function rnegbin which does what I want. I would still
> like to raise the above question (probably a more statistical one
> than R).
> Thanks a lot for any comments.
> Hadassa
> mailing list PLEASE do read the posting guide! Received on Sat Jul 15 00:41:02 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 02:14:59 EST.

Mailing list information is available at Please read the posting guide before posting to the list.