Last chance! 50% off unlimited learning
Sale ends in
rnbinom.gf
generates one or more independent time series following the Gamma frailty model. The generated data has negative binomial marginal distribution and the underlying multivariate Gamma frailty an autoregressive covariance structure.
get.groups(n, size, lambda, rho, tp, trend)
number of observations.
dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.
vector of means of trend parameters.
correlation coefficient of the underlying autoregressive Gamma frailty. Must be between 0 and 1.
number of observed time points.
a string giving the trend which is to be simulated.
get.groups
returns a matrix of dimension n
x tp
with marginal negative binomial
distribution with means corresponding to trend parameters lambda
, common dispersion parameter size
and a correlation induce by rho
,
the correlation coefficient of the autoregressive multivariate Gamma frailty.
The function relies on rnbinom.gf
for creating data with underlying constant or exponential trends.
Fiocco M, Putter H, Van Houwelingen JC, (2009), A new serially correlated gamma-frailty process for longitudinal count data Biostatistics Vol. 10, No. 2, pp. 245-257.
rnbinom.gf
for information on the Gamma frailty model.
# NOT RUN {
random<-get.groups(n=c(1000,1000), size=c(0.5, 0.5), lambda=c(1, 2), rho=c(0.6, 0.6), tp=7,
trend="constant")
head(random)
# }
Run the code above in your browser using DataLab