rqpois {predint} | R Documentation |
Sampling of overdispersed Poisson data with constant overdispersion
Description
rqpois()
samples overdispersed Poisson data with constant overdispersion from
the negative-binomial distribution such that the quasi-Poisson assumption is fulfilled.
The following description of the sampling process is based on the parametrization
used by Gsteiger et al. 2013.
Usage
rqpois(n, lambda, phi, offset = NULL)
Arguments
n |
defines the number of clusters ( |
lambda |
defines the overall Poisson mean ( |
phi |
dispersion parameter ( |
offset |
defines the number of experimental units per cluster ( |
Details
It is assumed that the dispersion parameter ()
is constant for all
clusters, such that the variance becomes
For the sampling is defined as
where and
. Then, the Poisson means
for each cluster are sampled from the gamma distribution
and the observations per cluster are sampled to be
Please note, that the quasi-Poisson assumption is not in contradiction with the
negative-binomial distribution, if the data structure is defined by the number
of clusters only (which is the case here) and the offsets are all the same
.
Value
a data.frame containing the sampled observations and the offsets
References
Gsteiger, S., Neuenschwander, B., Mercier, F. and Schmidli, H. (2013): Using historical control information for the design and analysis of clinical trials with overdispersed count data. Statistics in Medicine, 32: 3609-3622. doi:10.1002/sim.5851
Examples
# set.seed(123)
qp_dat1 <- rqpois(n=10, lambda=50, phi=3)
qp_dat1
# set.seed(123)
qp_dat2 <- rqpois(n=3, lambda=50, phi=3)
qp_dat2