[R] Negative Binomial: Simulation
Hadassa Brunschwig
dassybr at gmail.com
Fri Jul 14 15:18:34 CEST 2006
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 <dassybr at gmail.com> 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
>
More information about the R-help
mailing list