# dnegbinom: The Negative Binomial Distribution In mederrRank: Bayesian Methods for Identifying the Most Harmful Medication Errors

## Description

Density function for the negative binomial distribution with parameters alpha and prob.

## Usage

 1 dnegbinom(x, alpha, prob, log.p = FALSE) 

## Arguments

 x vector of (non-negative integer) quantiles. alpha target for number of successful trials. Must be strictly positive, need not be integer. prob probability of success in each trial. 0 < prob <= 1. log.p logical; if TRUE, probabilities p are given as log(p).

## Details

The negative binomial distribution with parameters alpha = α and prob = p has density

\frac{Γ(x + α)}{Γ(α) x!} p^α (1-p)^x

for x = 0,1,…,α > 0 and 0 < p ≤q 1. This represents the number of failures which occur in a sequence of Bernoulli trials before a target number of successes is reached.

## Value

dnegbinom gives the density corresponding to the alpha and prob values provided.

## Author(s)

Sergio Venturini [email protected],

Jessica A. Myers [email protected]

## References

DuMouchel W. (1999), "Bayesian Data Mining in Large Frequency Tables, with an Application to the FDA Spontaneous Reporting System". The American Statistician, 53, 177-190.

Myers, J. A., Venturini, S., Dominici, F. and Morlock, L. (2011), "Random Effects Models for Identifying the Most Harmful Medication Errors in a Large, Voluntary Reporting Database". Technical Report.

dmixnegbinom, dnbinom.