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:
[1] 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:
Contact Us