Fine-Gray subdistribution hazards model for competing risks using
cmprsk::crr().
Details
A separate Fine-Gray subdistribution hazards model is fitted for every cause in task$cmp_events.
This follows the LearnerCompRisks design: predictions contain CIFs for all available causes.
The fitted model is an S3 object of class "fine_gray" that stores a
cause-specific list of crr class models.
At prediction time, each cause-specific model is evaluated with
cmprsk::predict.crr() and the resulting CIF matrices are aligned to a common
time grid across causes using constant CIF interpolation.
The time grid is the unique event times (across all causes) observed in the training set.
Independently fitted cause-specific models can produce CIFs whose sum exceeds 1.
The corresponding warning is disabled package-wide by default, as it can recur on every prediction call.
Set options(mlr3cmprsk.warn_cif_sum = TRUE) to enable it.
See also Package Options section in mlr3cmprsk-package.
Time-interaction terms (via cov2) are not implemented.
Dictionary
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():
Meta Information
Task type: “cmprsk”
Predict Types: “cif”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cmprsk, cmprsk
Parameters
| Id | Type | Default | Levels | Range |
| cengroup | untyped | - | - | |
| gtol | numeric | 1e-06 | \([0, \infty)\) | |
| maxiter | integer | 10 | \([0, \infty)\) | |
| init | untyped | - | - | |
| variance | logical | TRUE | TRUE, FALSE | - |
References
Fine, P J, Gray, J R (1999). “A Proportional Hazards Model for the Subdistribution of a Competing Risk.” Journal of the American Statistical Association, 94(446), 496–509. doi:10.1080/01621459.1999.10474144 .
See also
Other competing risk learners:
mlr_learners_cmprsk.aalen
Super classes
mlr3::Learner -> LearnerCompRisks -> LearnerCompRisksFineGray
Methods
LearnerCompRisksFineGray$new()
Creates a new instance of this R6 class.
Usage
LearnerCompRisksFineGray$new()Examples
# Define a task
task = tsk("pbc")
task$select(c("age", "chol", "albumin", "ast", "bili", "protime"))
# Stratify by event status
task$set_col_roles(cols = "status", add_to = "stratum")
task
#>
#> ── <TaskCompRisks> (276x8): Primary Biliary Cholangitis ────────────────────────
#> • Target: time and status
#> • Properties: strata
#> • Features (6):
#> • dbl (4): albumin, ast, bili, protime
#> • int (2): age, chol
#> • Strata: status
# Create training and test sets
set.seed(42L)
part = partition(task)
# Define the learner
learner = lrn("cmprsk.fg")
# Train on the training set
learner$train(task, row_ids = part$train)
learner$native_model
#> $`1`
#> convergence: TRUE
#> coefficients:
#> age albumin ast bili chol protime
#> -0.0977200 -0.3992000 -0.0019480 0.0006162 0.0009104 -0.2221000
#> standard errors:
#> [1] 0.027980 0.924300 0.003838 0.076710 0.001232 0.393500
#> two-sided p-values:
#> age albumin ast bili chol protime
#> 0.00048 0.67000 0.61000 0.99000 0.46000 0.57000
#>
#> $`2`
#> convergence: TRUE
#> coefficients:
#> age albumin ast bili chol protime
#> 4.543e-02 -1.020e+00 3.061e-03 1.200e-01 6.019e-05 2.155e-01
#> standard errors:
#> [1] 0.0132100 0.2377000 0.0019090 0.0173200 0.0003912 0.1083000
#> two-sided p-values:
#> age albumin ast bili chol protime
#> 5.8e-04 1.8e-05 1.1e-01 4.3e-12 8.8e-01 4.7e-02
#>
#> attr(,"class")
#> [1] "fine_gray"
# Predict CIFs for the test set
predictions = learner$predict(task, row_ids = part$test)
predictions
#>
#> ── <PredictionCompRisks> for 92 observations: ──────────────────────────────────
#> row_ids time event CIF
#> 1 13 2 <list[2]>
#> 10 123 2 <list[2]>
#> 16 4 2 <list[2]>
#> --- --- --- ---
#> 157 73 1 <list[2]>
#> 208 27 1 <list[2]>
#> 213 47 1 <list[2]>
# Score predictions
predictions$score()
#> cmprsk.ibs
#> 0.1116802
