draw_negbinom: Draw samples from a negative binomial distribution (poisson...

Description Usage Arguments Details Value

View source: R/make_samples.R

Description

Draw samples from a negative binomial distribution (poisson log-normal mixture)

Usage

1
draw_negbinom(n, mu, sd)

Arguments

n

A vector of integer(-ish) values giving the sample sizes for each group

mu

A vector of reals > 0 giving the means for each group.

sd

A vector of reals > 0 giving the standard deviations for each group.

Details

This functions parametrises the negative binomial differently than the similar R function. Most notable difference is that apart from the mean, this function uses the standard deviation. While this is more intuitive than the "size", it does complicate things a bit since allowable value for the standard deviation depend on the mean. The function checks this.

In addition, the lengths of n, mu, and sd should be either the number of groups or 1, in which case it is assumed to be the same for all groups.

Value

A function generating samples from the specified negative binomial distributions


colinorourke/simpower documentation built on May 21, 2019, 1:42 a.m.