mlr_task_generators_coxed | R Documentation |
A mlr3::TaskGenerator calling coxed::sim.survdata()
.
This generator creates a survival dataset using coxed, and exposes
some parameters from the sim.survdata()
function.
We don't include the parameters X
(user-specified variables), covariate
,
low
, high
, compare
, beta
and hazard.fun
for this generator.
The latter means that no user-specified hazard function can be used and the
generated datasets always use the flexible-hazard method from the package.
This TaskGenerator can be instantiated via the dictionary mlr_task_generators or with the associated sugar function tgen()
:
mlr_task_generators$get("coxed") tgen("coxed")
Id | Type | Default | Levels | Range |
T | numeric | 100 | [1, \infty) |
|
type | character | none | none, tvc, tvbeta | - |
knots | integer | 8 | [1, \infty) |
|
spline | logical | TRUE | TRUE, FALSE | - |
xvars | integer | 3 | [1, \infty) |
|
mu | untyped | 0 | - | |
sd | untyped | 0.5 | - | |
censor | numeric | 0.1 | [0, 1] |
|
censor.cond | logical | FALSE | TRUE, FALSE | - |
mlr3::TaskGenerator
-> TaskGeneratorCoxed
new()
Creates a new instance of this R6 class.
TaskGeneratorCoxed$new()
help()
Opens the corresponding help page referenced by field $man
.
TaskGeneratorCoxed$help()
clone()
The objects of this class are cloneable with this method.
TaskGeneratorCoxed$clone(deep = FALSE)
deep
Whether to make a deep clone.
Harden, J. J, Kropko, Jonathan (2019). “Simulating Duration Data for the Cox Model.” Political Science Research and Methods, 7(4), 921–928. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/PSRM.2018.19")}.
Dictionary of TaskGenerators: mlr3::mlr_task_generators
as.data.table(mlr_task_generators)
for a table of available TaskGenerators in the running session
Other TaskGenerator:
mlr_task_generators_simdens
,
mlr_task_generators_simsurv
library(mlr3)
# time horizon = 365 days, censoring proportion = 60%, 6 covariates normally
# distributed with mean = 1 and sd = 2, independent censoring, no time-varying
# effects
gen = tgen("coxed", T = 365, type = "none", censor = 0.6, xvars = 6,
mu = 1, sd = 2, censor.cond = FALSE)
gen$generate(50)
# same as above, but with time-varying coefficients (counting process format)
gen$param_set$set_values(type = "tvc")
gen$generate(50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.