Compute the Value of Negative Binomial Quantile Function in R Programming – qnbinom() Function
Last Updated :
25 Jun, 2020
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:
x < - seq( 0 , 1 , by = 0.1 )
y < - qnbinom(x, size = 100 , prob = 0.5 )
y
|
Output:
[1] 0 82 88 92 96 99 103 107 112 118 Inf
Example 2:
x < - seq( 0 , 1 , by = 0.01 )
y < - qnbinom(x, size = 100 , prob = 0.8 )
plot(y)
|
Output:
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...