View source: R/data_preparation.R
| create_indicator_matrix | R Documentation |
Converts NA entries in a longitudinal label matrix (as produced
by create_longitudinal_labels) into a binary indicator
matrix. This indicator is used by orthoMTL to mask
censored observations in the loss computation.
create_indicator_matrix(Y)
Y |
A numeric matrix of dimensions |
A numeric matrix of the same dimensions as Y.
1 = label is observed (known), 0 = label is censored
(unknown).
create_longitudinal_labels
set.seed(42)
SurvTime <- rexp(10, rate = 0.1)
Event <- rbinom(10, 1, 0.7)
Y <- create_longitudinal_labels(SurvTime, Event, c(4, 6, 10))
W <- create_indicator_matrix(Y)
W # 1 = observed, 0 = censored
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.