Learn R Programming

predint (version 2.2.1)

rqpois: 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)

Value

a data.frame containing the sampled observations and the offsets

Arguments

n

defines the number of clusters (\(I\))

lambda

defines the overall Poisson mean (\(\lambda\))

phi

dispersion parameter (\(\Phi\))

offset

defines the number of experimental units per cluster (\(n_i\))

Details

It is assumed that the dispersion parameter (\(\Phi\)) is constant for all \(i=1, ... I\) clusters, such that the variance becomes $$var(y_i) = \Phi n_i \lambda$$ For the sampling \(\kappa_i\) is defined as $$\kappa_i=(\Phi-1)/(n_i \lambda)$$ where \(a_i=1/\kappa_i\) and \(b_i=1/(\kappa_i n_i \lambda)\). Then, the Poisson means for each cluster are sampled from the gamma distribution $$\lambda_i \sim Gamma(a_i, b_i)$$ and the observations per cluster are sampled to be $$y_i \sim Pois(\lambda_i).$$ 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 \(n_h = n_{h´} = n\).

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. tools:::Rd_expr_doi("10.1002/sim.5851")

Examples

Run this code
# 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


Run the code above in your browser using DataLab