Description Usage Arguments Value Author(s) See Also Examples
simulate longitudinal responses and event times from joint models
1 2 3 4 5 6 7  simulateJM(nsim, nsub, thetas, times, formulas, Data = NULL,
method = c("weibullPH", "weibullAFT", "piecewisePH", "splinePH"),
lag = 0, censoring = "uniform", max.FUtime = NULL, seed = NULL,
return.ranef = FALSE)
## S3 method for class 'jointModel'
simulate(object, nsim, seed = NULL, times = NULL,
Data = NULL, ...)

nsim 
number of data sets to be simulated. 
nsub 
the number of subjects in each data set. 
thetas 
a list with the parameter values. This should be of the same structure as
the 
times 
a numeric vector denoting the time points at which longitudinal measurements are planned to be taken. 
formulas 
a list with components: 
Data 
a data frame containing any covariates used in the formulas defined in the

method 
a character string indicating from what type of survival submodel to simulate.
There are the same options as the ones provided by 
lag 
a numeric value denoting a lagged effect; the same as the 
censoring 
a character string or a numeric vector. 
max.FUtime 
a numeric value denoting the maximum followup time for the study. The default
is 
seed 
an object specifying if and how the random number generator should
be initialized ('seeded'). It could be either 
return.ranef 
logical; if 
object 
an object inheriting from class 
... 
additional arguments; currently none is used. 
A list of length nsim
of data frames that contains the simulated responses
for the longitudinal process "y", the simulated event times "Time", the event indicator
"Event", and the subject identification number "id". If extra covariates were assumed,
these are also included.
Dimitris Rizopoulos [email protected]
1 2 3 4 5 6 7 8 9 10 11  ## Not run:
prothro$t0 < as.numeric(prothro$time == 0)
lmeFit < lme(pro ~ treat * (time + t0), random = ~ time  id, data = prothro)
survFit < coxph(Surv(Time, death) ~ treat, data = prothros, x = TRUE)
jointFit < jointModel(lmeFit, survFit, timeVar = "time",
method = "weibullPHaGH")
newData < simulate(jointFit, nsim = 1, times = seq(0, 11, len = 15))
newData
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.