random_N: Random generation of sample sizes (N) for study outcomes.

Description Usage Arguments Value

View source: R/random_N.R

Description

Generates random sample sizes (N) by either sampling from a Negative Binomial or Poisson distribution.

Usage

1
random_N(K, method = "NegativeBinomial", mean = 15, min = 3, NB_size = 15)

Arguments

K

Number of sample sizes to generate.

method

A string that defines what sampling distribution to generate random N. The default is "NegativeBinomial" but a "Poisson" distribution can also be used.

mean

The population mean (mu) if "NegativeBinomial", or the lambda (dispersion parameter) if "Poisson". The default is 15, which will generate sample sizes that on average will center around N = 15.

min

A non-negative integer that specifies the minimum sample size that can be generated. Default is N = 3.

NB_size

Dispersion parameter for the "Negative Binomial" distribution that must be strictly positive, but need not be integer. Default is 15, which creates a long tail for random N's ranging to about N = 60. Increase value to create a longer tail of random sample sizes.

Value

A vector of random sample sizes (N).


metagear documentation built on Feb. 15, 2021, 5:09 p.m.