spass (version 1.2)

get.groups: Generate Time Series with Negative Binomial Distribution and Multivariate Gamma Frailty with Autoregressive Correlation Structure of Order One with Trend

Description

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.

Usage

get.groups(n, size, lambda, rho, tp, trend)

Arguments

n

number of observations.

size

dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.

lambda

vector of means of trend parameters.

rho

correlation coefficient of the underlying autoregressive Gamma frailty. Must be between 0 and 1.

tp

number of observed time points.

trend

a string giving the trend which is to be simulated.

Value

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.

Details

The function relies on rnbinom.gf for creating data with underlying constant or exponential trends.

References

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.

See Also

rnbinom.gf for information on the Gamma frailty model.

Examples

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