simulatejointRecCompet {frailtypack} | R Documentation |
Generating from a joint competing Joint frailty model with a recurrent event and two terminal events.
Description
Generates data under a joint frailty model for a single recurrent event and two terminal events in a calendar-time format. Only a single covariate representing the treatment is allowed. Event times are generated under Weibull distributions.
Usage
simulatejointRecCompet(n, censoring = 28, maxrecurrent = 50,
par0 = c(shapeR = 1.5, scaleR = 10,
shapeM = 1.75, scaleM = 16,
shapeD = 1.75, scaleD = 16,
sigma = 0.5, alphaM = 1, alphaD = 0,
betaR = -0.5, betaM = -0.5, betaD = 0))
Arguments
n |
Number of subjects. Default is 1500. |
censoring |
A number indicating a fixed right censoring time for all subjects
(as an administrative censoring). If |
maxrecurrent |
Maximum number of recurrent events per subject.
If |
par0 |
A vector of arguments controlling the parameters of the generating model.
|
Value
Returns a data.frame
object with the following columns:
id
Id number for each subjecttreatment
Binary treatment indicatortstart
Start time of the observation periodtstop
Stop time of the observation periodrecurrent
Censoring indicator for the recurrent eventterminal1
Censoring indicator for the first terminal eventterminal2
Censoring indicator for the second terminal event