#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to implement Negative Binomial Distribution in R?

To implement the negative binomial distribution using R programming.


Four main functions in binomial distribution:

dnbinom(x, size= ,prob=)


  • Gives height of the probability distribution at each point


pnbinom(x, size= ,prob=)

  • Gives the cumulative probability of an event

qnbinom(p, size= ,prob=)

  • It takes the probability value and gives a number whose cumulative value matches the probability value.

rnbinom(x, size= ,prob=)

  • Used to generate random numbers whose distribution is binomial.
  • x — vector
  • Size — Number of success trials
  • Prob — Probability of success trails
Sapmle Code

#Negative Binomial Distribution
x y plot(x,y,col=”blue”)

y plot(x,y,col=”red”)

y print(y)

x hist(x,col=285)