NB: Draw nonzero negative binomial random numbers

Description Usage Arguments Value Examples

View source: R/NB.R

Description

Draw nonzero negative binomial random numbers

Usage

1
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

1
2
  randomNBs = NB(c(100, 4, 29), size=c(50, 2, 4), seed=21)
  randomNBs  # 115, 5, 15

alyssafrazee/polyester documentation built on Sept. 17, 2021, 8:54 a.m.