rBetaBin {FlexReg} | R Documentation |
Random generator from the beta-binomial distribution
Description
The function generates random values from the beta-binomial distribution.
Usage
rBetaBin(n, size = NULL, mu = NULL, theta = NULL, phi = NULL)
Arguments
n |
the number of values to generate. If |
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, an alternative way to specify the overdispersion parameter |
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
rBetaBin(n = 100, size = 40, mu = .5, theta = .4)
rBetaBin(n = 100, size = 40, mu = .5, phi = 1.5)
[Package FlexReg version 1.3.0 Index]