# Plotting the pdf of a negative binomial distribution using mean and stnd deviation

#### catbelize

##### New Member
I have been using a negative binomial distribution to describe my data; in order to allow me to randomly sample from the parameterised distributions. I have had no problems getting r (the number of successes) and p (the probability of success) for my distribution. My problem is that I would like to compare my pdf to results from a much older paper, wherein the negative binomial distribution was described in relation to it's mean and standard deviation (sd).
I use both minitab and spss and am curious as to how I plot the negative binomial pdf based on these two parameters (mean and sd). Everywhere I have looked only describes this distribution in terms of its r and p parameters.

#### BGM

##### TS Contributor
Re: Plotting the pdf of a negative binomial distribution using mean and stnd deviatio

Simply express the parameters $$r, p$$ in terms of the given mean and sd -
i.e. solving a 2x2 system of non-linear equations.

#### catbelize

##### New Member
Re: Plotting the pdf of a negative binomial distribution using mean and stnd deviatio

I'm afraid my maths background isn't great....what exactly do you mean by express the parameters in terms of the sd and mean?

#### BGM

##### TS Contributor
Re: Plotting the pdf of a negative binomial distribution using mean and stnd deviatio

Suppose the random variable $$X \sim \text{NegBin}(r, p)$$ which use the following parametrization:

http://en.wikipedia.org/wiki/Negative_binomial_distribution

then we have

$$E[X] = \frac {pr} {1 - p}, SD[X] = \frac {\sqrt{pr}} {1 - p}$$

As $$E[X], SD[X]$$ are given constants, we have a system of non-linear equations in $$r, p$$ which we can solve.