random_N {metagear}R Documentation

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

Description

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

Usage

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).


[Package metagear version 0.7 Index]