[R] Negative Binomial: Simulation

From: Hadassa Brunschwig <dassybr_at_gmail.com>
Date: Fri 14 Jul 2006 - 23:15:40 EST

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.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 14 23:22:25 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:19 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.