Simulate datasets from a fitted flexsurvreg model
# S3 method for flexsurvreg
simulate(
object,
nsim = 1,
seed = NULL,
censtime = NULL,
vectorised = TRUE,
...
)
A data frame with nsim
pairs of columns named
"sim_1","event_1"
and so on, containing the simulated event or
censoring times, and an indicator for whether the event was observed.
Object returned by flexsurvreg
Number of datasets to simulate
Random number seed. This is returned with the result of this
function as described in simulate
.
Right-censoring time, or vector of right-censoring times of the same size as the data used to fit the model.
Set to FALSE
if the fitted model uses distribution
functions from a package other than flexsurv and those functions are
not vectorised. By default, this function assumes that they are
vectorised. Incomprehensible warnings may be printed and the simulation is
not guaranteed to work if this assumption is wrong. Vectorising will
generally make the simulation much faster.
Currently unused.