SimulateComplete {dejaVu} | R Documentation |
Simulate a complete data set
Description
Simulate a complete data set of a recurrent event clinical trial without dropouts using a negative binomial model with given rates and dispersion parameters
Usage
SimulateComplete(
study.time,
dejaData = NULL,
number.subjects = NULL,
event.rates = NULL,
dispersions
)
Arguments
study.time |
The study follow up period |
dejaData |
If not NULL this should contain a |
number.subjects |
The number of subjects, if a vector |
event.rates |
The rate parameter(s) for the negative binomial model (if single parameter then it is used for both arms) |
dispersions |
The dispersion parameter(s) for the negative binomial model (if single parameter then it is used for both arms) |
Details
Each subject's events are described by a Poisson process with a subject specific rate given by
lambda/study.time
where study.time
is the study follow up period and lambda
has a gamma distribution with shape=1/dispersion
and scale=dispersion*event.rate*study.time
Different dispersions, event.rates and number of subjects can be specified for both arms of the trial
Value
A SingleSim
object with status='complete'
See Also
Examples
sim <- SimulateComplete(study.time=365,number.subjects=50,
event.rates=c(0.01,0.005),dispersions=0.25)
sim2 <- SimulateComplete(study.time=365,number.subjects=c(50,75),
event.rates=c(0.01,0.005),dispersions=c(0,0.25))