get_cox_risk_and_failure_sets: Calculate Risk and Failure Sets for Cox Proportional Hazards...

get_cox_risk_and_failure_setsR 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.


catalytic documentation built on April 4, 2025, 5:51 a.m.