Simulate survival times from standard parametric survival
distributions (exponential, Weibull, Gompertz), 2-component mixture
distributions, or a user-defined hazard, log hazard, cumulative hazard,
or log cumulative hazard function. Baseline covariates can be included
under a proportional hazards assumption.
Time dependent effects (i.e. non-proportional hazards) can be included by
interacting covariates with linear time or a user-defined function of time.
Clustered event times are also accommodated.
The 2-component mixture distributions can allow for a variety of flexible
baseline hazard functions reflecting those seen in practice.
If the user wishes to provide a user-defined
hazard or log hazard function then this is possible, and the resulting
cumulative hazard function does not need to have a closed-form solution.
For details see the supporting paper
Current development version
rootfunargument has been added. This allows the user to apply any transformation to each side of the root finding equation. The default is
rootfun = logwhich corresponds to
unirootsolving -H(t) - log(u) = 0.
rootsolverargument has been added. This allows the user to choose between stats::uniroot or BB::dfsane for the root finding.
unirootfunction (called internally by
simsurv) now solves - H(t) - log(u) = 0 instead of exp(-H(t)) - u = 0, i.e. it is on log scale.
simsurvsupports a lower limit of zero (thanks to Alessandro Gasparini, @ellessenne).
Initial CRAN release