rFBB: Random generator from the flexible beta-binomial distribution

Description Usage Arguments Value References Examples

View source: R/rgen.R

Description

The function randomly generates values from the flexible beta-binomial distribution.

Usage

1
rFBB(n, size = NULL, mu, theta = NULL, phi = NULL, p, w)

Arguments

n

the number of observations. If length(n) > 1, the length is taken to be the number required.

size

the total number of trials.

mu

the mean parameter. It must lie in (0, 1).

theta

the overdispersion parameter. It must lie in (0, 1).

phi

the precision parameter. It is an alternative way to specify the theta parameter. It must be a positive real value.

p

the mixing weight. It must lie in (0, 1).

w

the normalized distance among clusters. It must lie in (0, 1).

Value

A vector of length n.

References

Ascari, R., Migliorati, S. (2021). A new regression model for overdispersed binomial data accounting for outliers and an excess of zeros. Statistics in Medicine, 40(17), 3895–3914. doi:10.1002/sim.9005

Examples

1
2
rFBB(n = 100, size = 40, mu = 0.5, theta = .4, p = 0.3, w = 0.6)
rFBB(n = 100, size = 40, mu = 0.5, phi = 1.5, p = 0.3, w = 0.6)

FlexReg documentation built on Jan. 17, 2022, 5:06 p.m.