Learn R Programming

polyester (version 1.8.3)

NB: Draw nonzero negative binomial random numbers

Description

Draw nonzero negative binomial random numbers

Usage

NB(basemeans, size, seed = NULL)

Arguments

basemeans
vector of means, one per draw
size
vector of size parameters (controlling the mean/variance relationship); one per draw
seed
optional seed to set before drawing

Value

vector of negative binomial draws from specified distributions, where any zero draw is replaced with a 1. Length of return vector is equal to length(basemeans).

Examples

Run this code
## Not run: 
#   randomNBs = NB(c(100, 4, 29), size=c(50, 2, 4), seed=21)
#   randomNBs  # 115, 5, 15
# ## End(Not run)

Run the code above in your browser using DataLab