# Compute the Value of Negative Binomial Quantile Function in R Programming – qnbinom() Function

`qnbinom()` function in R Language is used to compute the value of negative binomial quantile function. It also creates a density plot of the negative binomial quantile function.

Syntax: qnbinom(vec, size, prob)

Parameters:
vec: x-values for binomial density
size: Number of trials
prob: Probability

Example 1:

 `# R program to compute value of ` `# Negative Binomial Quantile Function ` ` `  `# Vector of x-values ` `x <``-` `seq(``0``, ``1``, by ``=` `0.1``) ` ` `  `# Calling qnbinom() Function ` `y <``-` `qnbinom(x, size ``=` `100``, prob ``=` `0.5``) ` `y `

Output:

```    0  82  88  92  96  99 103 107 112 118 Inf
```

Example 2:

 `# R program to compute value of ` `# Negative Binomial Quantile Function ` ` `  `# Vector of x-values ` `x <``-` `seq(``0``, ``1``, by ``=` `0.01``) ` ` `  `# Calling qnbinom() Function ` `y <``-` `qnbinom(x, size ``=` `100``, prob ``=` `0.8``) ` ` `  `# Plot a graph ` `plot(y) `

Output: My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.