A mlr3::TaskGenerator calling simsurv::simsurv() from package simsurv.

This generator currently only exposes a small subset of the flexibility of simsurv, and just creates a small data set with the following numerical covariates:

  • treatment: Bernoulli distributed with log hazard ratio -0.5.

  • height: Normally distributed with log hazard ratio 1.

  • weight: normally distributed with log hazard ratio 0.

See simsurv::simsurv() for an explanation of the hyperparameters.

Format

R6::R6Class inheriting from mlr3::TaskGenerator.

Construction

TaskGeneratorSimsurv$new()
mlr_task_generators$get("simsurv")
tgen("simsurv")

See also

Examples

generator = mlr3::mlr_task_generators$get("simsurv") task = generator$generate(200) task$head()
#> eventtime status height treatment weight #> 1: 5.000000 0 185.1217 0 75.49761 #> 2: 1.805076 1 168.4857 1 72.83456 #> 3: 3.772984 1 171.8486 0 77.36291 #> 4: 4.860986 1 160.6983 1 91.51049 #> 5: 5.000000 0 197.4536 0 106.28269 #> 6: 5.000000 0 184.8471 0 71.75781
plot(task$survfit())