Description Usage Arguments Details Value Author(s) References See Also Examples
Simulation of cohorts in a context of multiple event survival analysis including several covariates, individual heterogeneity and periods at risk prior and after the start of follow-up.
Multiple event data occurs when each subject can have more than one event of entirely different natures (Kelly, 2000). Examples of this type of event are the occurrence of tumours at different sites in the body or multiple sequalae after a surgery.
We can obtain the observation time of the k-th event in the i-th subject, y_ik, in the same manner that we can simulate k simple independent survival data. Notice that, in multiple-type events, T_{ik} and C_{i} are mutually independent and, furthermore, the failure in each event is independent of the others (within each subject all y_ik are independents for all k).
1 2 | mult.ev.sim(n, foltime, dist.ev, anc.ev, beta0.ev, dist.cens="weibull",
anc.cens, beta0.cens, z=NULL, beta=NA, x=NA, nsit)
|
n |
integer value indicating the desired size of the cohort to be simulated. |
foltime |
real number that indicates the maximum time of follow-up of the simulated cohort. |
dist.ev |
vector of arbitrary size indicating the time to event distributions, with possible values |
anc.ev |
vector of arbitrary size of real components containing the ancillary parameters for the time to event distributions. |
beta0.ev |
vector of arbitrary size of real components containing the β_0 parameters for the time to event distributions. |
dist.cens |
string indicating the time to censoring distributions, with possible values |
anc.cens |
real number containing the ancillary parameter for the time to censoring distribution or the maximum in case of uniform distributed time to censoring. |
beta0.cens |
real number containing the β_0 parameter for the time to censoring distribution or the minimum in case of uniform distributed time to censoring. |
z |
list of vectors with three elements containing information relative to a random effect used in order to introduce individual heterogeneity. Each vector in the list refers to a possible event, so the number of vectors must be equal to |
beta |
list of vectors indicating the effect of the corresponding covariate. The number of vectors in |
x |
list of vectors indicating the distribution and parameters of any covariate that the user needs to introduce in the simulated cohort. The possible distributions are |
nsit |
Number of different events that a subject can suffer. It must match the number of distributions specified in |
In order to get the function to work properly, the length of the vectors containing the parameters of the time to event and the number of distributions indicated in the parameter dist.ev
must be the same.
An object of class mult.ev.data.sim
. It is a data frame containing the events suffered by the corresponding subjects. The columns of this data frame are detailed below
nid |
an integer number that identifies the subject. |
ev.num |
number of the event corresponding to the follow-up time of the individual. |
time |
time until the corresponding event happens (or time to subject drop-out). |
status |
logical value indicating if the corresponding event has been suffered or not. |
start |
time at which the follow-up time begins for each event. |
stop |
time at which the follow-up time ends for each event. |
z |
Individual heterogeneity generated according to the specified distribution. |
x |
value of each covariate randomly generated for each subject in the cohort. |
David Moriña, Universitat de Barcelona and Albert Navarro, Universitat Autònoma de Barcelona
Kelly PJ, Lim LL. Survival analysis for recurrent event data: an application to childhood infectious diseases. Stat Med 2000 Jan 15;19(1):13-33.
Bender R, Augustin T, Blettner M. Generating survival times to simulate Cox proportional hazards models. Stat Med 2005 Jun 15;24(11):1713-1723.
Metcalfe C, Thompson SG. The importance of varying the event generation process in simulation studies of statistical methods for recurrent events. Stat Med 2006 Jan 15;25(1):165-179.
Moriña D, Navarro A. The R package survsim for the simulation of simple and complex survival data. Journal of Statistical Software 2014 Jul; 59(2):1-20.
survsim-package
, accum
, rec.ev.sim
, crisk.sim
, simple.surv.sim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ### A cohort with 1000 subjects, with a maximum follow-up time of 3600 days and two
### covariates, following a Bernoulli and uniform distribution respectively, and a
### corresponding beta of -0.4, -0.5, -0.6 and -0.7 for each event for the first
### covariate and a corresponding beta of 0, 0, 0 and 1 for each event for the
### second covariate. Notice that the time to censorship is assumed to follow a
### Weibull distribution, as no other distribution is stated and random effect is
### the same for all events.
sim.data <- mult.ev.sim(n=1000, foltime=3600, dist.ev=c('llogistic','weibull',
'weibull','weibull'),anc.ev=c(0.69978200185280, 0.79691659193027,
0.82218416457321, 0.85817155198598),beta0.ev=c(5.84298525742252, 5.94362650803287,
5.78182528904637, 5.46865223339755),,anc.cens=1.17783687569519,
beta0.cens=7.39773677281100,z=list(c("unif", 0.8,1.2)), beta=list(c(-0.4,-0.5,-0.6,-0.7),
c(0,0,0,1)), x=list(c("bern", 0.5), c("unif", 0.7, 1.3)), nsit=4)
summary(sim.data)
|
Loading required package: eha
Loading required package: survival
Loading required package: statmod
Number of subjects at risk
----------------------------
ev.num sub.risk
1 1000
2 1000
3 1000
4 1000
Number of events
----------------------------
ev.num num.events
1 799
2 863
3 866
4 807
Total time of follow-up
----------------------------
ev.num foltime
1 381881.2
2 303286.9
3 245119.9
4 372714.3
Time of follow-up (median)
----------------------------
ev.num med.foltime
1 230.6652
2 163.3865
3 147.0684
4 236.4176
Density of incidence
----------------------------
ev.num dens.incid
1 0.002092274
2 0.002845490
3 0.003532965
4 0.002165197
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.