Evaluate Survival Model Performance
test_eval.RdComputes predictive performance metrics for stratified or unstratified Cox models. Supports Loss, C-index, Integrated Brier Score (IBS), and Time-Dependent AUC (tdAUC).
Usage
test_eval(
test_z,
test_delta,
test_time,
betahat,
test_stratum = NULL,
train_baseline_obj = NULL,
criteria = c("loss", "CIndex", "IBS", "tdAUC")
)Arguments
- test_z
Matrix of predictors for the test set.
- test_delta
Numeric vector of event indicators (1 for event, 0 for censored).
- test_time
Numeric vector of observed times.
- betahat
Numeric vector of estimated coefficients.
- test_stratum
Vector indicating strata for test subjects. Defaults to NULL (single stratum).
- train_baseline_obj
A list containing the baseline hazard function (typically from
get_baseline_hazard). Required only whencriteria = "IBS".- criteria
Metric to calculate: "loss" (Log-Partial Likelihood), "CIndex" (Concordance Index), "IBS" (Integrated Brier Score), or "tdAUC" (Integrated Time-Dependent AUC).