-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
When there is a time-tie between an event and a censoring, the Uno C-index from sksurv-survival is not equal to that found with the survAUC package on R.
Reproducible example:
sksurv-survival with tie
import numpy as np
from sksurv.metrics import concordance_index_ipcw
test_survival_time = np.array([11., 11., 26., 89., 128., 299., 300.])
test_survival_status = np.array([1, 0, 0, 1, 0, 1, 0])
y_test = np.array(list(zip(test_survival_status, test_survival_time)), dtype=[('survival', '?'), ('futime', '<i8')])
risk_score = np.array([-0.02, 1.20, -0.56, -1.33, -0.81, 1.02, -1.29])
c_uno = concordance_index_ipcw(y_test, y_test, risk_score, tau= 299 )[0]
print(c_uno)= 0.37426900584795325
survAUC with tie
library(survAUC)
futime = c(11, 11, 26, 89, 128, 299, 300)
fustat = c(1, 0, 0, 1, 0, 1, 0)
Surv.rsp.new = survival::Surv(futime, fustat)
lpnew = c(-0.02, 1.20, -0.56, -1.33, -0.81, 1.02, -1.29)
C_Uno = UnoC(Surv.rsp.new, Surv.rsp.new, lpnew, time =299)
print(C_Uno)= 0.4129032
Note that without the tie, the results would be the same.
sksurv-survival without tie
test_survival_time_2 = np.array([11., 26., 89., 128., 299., 300.])
test_survival_status_2 = np.array([1, 0, 1, 0, 1, 0])
y_test_2 = np.array(list(zip(test_survival_status_2, test_survival_time_2)), dtype=[('survival', '?'), ('futime', '<i8')])
risk_score_2 = np.array([-0.02, -0.56, -1.33, -0.81, 1.02, -1.29])
c_uno_2 = concordance_index_ipcw(y_test_2, y_test_2, risk_score_2, tau= 299 )[0]
print(c_uno_2)= 0.4129032258064516
survAUC without tie
futime_2 = c(11, 26, 89, 128, 299, 300)
fustat_2 = c(1, 0, 1, 0, 1, 0)
Surv.rsp.new_2 = survival::Surv(futime_2, fustat_2)
lpnew = c(-0.02, -0.56, -1.33, -0.81, 1.02, -1.29)
C_Uno_2 = UnoC(Surv.rsp.new_2, Surv.rsp.new_2, lpnew, time =299)
print(C_Uno_2)= 0.4129032
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels