get_cox_risk_and_failure_sets {catalytic} | R Documentation |
Calculate Risk and Failure Sets for Cox Proportional Hazards Model
Description
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.
Usage
get_cox_risk_and_failure_sets(time_vector, status_vector, indicator_vector)
Arguments
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. |
Value
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.
[Package catalytic version 0.1.0 Index]