get_risk_obj | R Documentation |
Get the risk set at each bin over an equidistant distant grid.
get_risk_obj( Y, by, max_T, id, is_for_discrete_model = TRUE, n_threads = 1, min_chunk = 5000 )
Y |
vector of outcome variable returned from |
by |
length of each bin. |
max_T |
last observed time. |
id |
vector with ids where entries match with outcomes |
is_for_discrete_model |
|
n_threads |
set to a value greater than one to use |
min_chunk |
minimum chunk size of ids to use when parallel version is used. |
a list with the following elements
risk_sets |
list of lists with one for each bin. Each of the sub lists have indices that corresponds to the entries of |
min_start |
start time of the first bin. |
I_len |
length of each bin. |
d |
number of bins. |
is_event_in |
indices for which bin an observation |
is_for_discrete_model |
value of |
# small toy example with time-varying covariates dat <- data.frame( id = c(1, 1, 2, 2), tstart = c(0, 4, 0, 2), tstop = c(4, 6, 2, 4), event = c(0, 1, 0, 0)) with(dat, get_risk_obj(Surv(tstart, tstop, event), by = 1, max_T = 6, id = id))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.