Concordance Index
Calculates the concordance index for discrete survival models (independent measure of time). This is the probability that, for a pair of randomly chosen comparable samples, the sample with the higher risk prediction will experience an event before the other sample or belongs to a higher binary class.
concorIndex(aucObj, printTimePoints=FALSE)
aucObj |
Object of class "discSurvAucUno". This object is created using the function |
printTimePoints |
Should messages be printed for each calculation of a discrete time interval? (logical scalar) Default is FALSE. |
The algorithm extracts all necessary information of the auc object (e. g. marginal probabilities and survival functions).
List with objects
Output: Concordance index (named numeric vector)
Input: List with all input arguments (saved for reference)
It is assumed that all time points up to the last observed interval [a_q-1, a_q) are available. If not already present, these can be added manually.
Thomas Welchowski welchow@imbie.meb.uni-bonn.de
Matthias Schmid matthias.schmid@imbie.uni-bonn.de
Matthias Schmid, Gerhard Tutz and Thomas Welchowski, (2017), Discrimination Measures for Discrete Time-to-Event Predictions, Econometrics and Statistics, Elsevier, DOI: 10.1016/j.ecosta.2017.03.008
Hajime Uno and Tianxi Cai and Lu Tian and L. J. Wei, (2007), Evaluating Prediction Rules for t-Year Survivors With Censored Regression Models, Journal of the American Statistical Association
Patrick J. Heagerty and Yingye Zheng, (2005), Survival Model Predictive Accuracy and ROC Curves, Biometrics 61, 92-105
# Example with cross validation and unemployment data library(Ecdat) library(caret) data(UnempDur) # Evaluation of short term prediction for re-employed at full-time job # Last interval q=14 # -> Set all time points with spell > 13 to time interval 13 and censored lastObsInterval <- 13 UnempDurSubset <- UnempDur UnempDurSubset[UnempDurSubset$spell > lastObsInterval, "censor1"] <- 0 UnempDurSubset[UnempDurSubset$spell > lastObsInterval, "spell"] <- lastObsInterval head(UnempDurSubset) range(UnempDurSubset$spell) # Select cross-validation samples set.seed(7550) CVfolds <- createFolds (y=UnempDurSubset$spell, returnTrain=TRUE, k=2) # Continuation ratio model formula contModForm <- spell ~ logwage + ui + logwage*ui + age # Estimate true positive rate of time interval 6: # Correspondes to three and a half month duration (each interval is of length two weeks) tryTPR <- tprUno (timepoint=6, dataSet=UnempDurSubset, trainIndices=CVfolds, survModelFormula=contModForm, censModelFormula=censor1 ~ 1, linkFunc="logit", idColumn=NULL, timeAsFactor=FALSE) tryTPR plot(tryTPR) # Estimate false positive rate of time interval 6: tryFPR <- fprUno (timepoint=6, dataSet=UnempDurSubset, trainIndices=CVfolds, survModelFormula=contModForm, censModelFormula=censor1 ~ 1, linkFunc="logit", idColumn=NULL, timeAsFactor=FALSE) tryFPR plot(tryFPR) # Estimate AUC rate of time interval 6: tryAUC <- aucUno (tprObj=tryTPR, fprObj=tryFPR) tryAUC plot(tryAUC) ## Not run: # Estimate global concordance index: tryConcorIndex <- concorIndex (tryAUC, printTimePoints=TRUE) tryConcorIndex summary(tryConcorIndex) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.