get_cox_risk_and_failure_sets | R Documentation |
This function calculates the risk and failure sets for subjects in a Cox proportional hazards model based on their time-to-event data, status, and an indicator vector.
get_cox_risk_and_failure_sets(time_vector, status_vector, indicator_vector)
time_vector |
A numeric vector of time-to-event data for each subject. |
status_vector |
A numeric vector indicating event occurrence (1 = event, 0 = censored). |
indicator_vector |
A numeric vector representing the indicator times used to define risk and failure sets. |
A list containing two elements:
risk_set
: A matrix indicating which subjects are at risk at each time point.
failure_set
: A matrix indicating which subjects experienced an event at each time point.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.