True positive Rate Uno
Estimates the true positive rate based on Uno et al. to evaluate the predictive accuracy of discrete generalized, linear survival models by cross validation.
tprUno(timepoint, dataSet, trainIndices, survModelFormula, censModelFormula, linkFunc = "logit", idColumn = NULL, timeAsFactor=TRUE)
timepoint |
Discrete time interval given that the false positive rate is evaluated (integer scalar) |
dataSet |
Original data in short format. Should be of class "data.frame". |
trainIndices |
List of Indices from original data used for training (list of integer vectors). The length of the list is equal to the number of cross validation samples. |
survModelFormula |
Formula of the discrete survival model. It is used in a generalized, linear model. |
censModelFormula |
Formula of the censoring model. It is used in a generalized, linear model. Usually this is done without covariates. |
linkFunc |
Link function of the generalized, linear model. |
idColumn |
Name of the column with identification numbers of persons. Default NULL means, that each row equals one person (no repeated measurements). |
timeAsFactor |
Should the time intervals be coded as factor? Default is to use factor. If the argument is false, the column is coded as numeric. |
The formula survModelFormula
must be in a specific structure: The response on the left side of the formula is the time of the short data format. On the right side are the covariates without time, e. g. Time ~ X1 + X2 if there are only two covariates. The time will be added automatically.
The next formula survModelFormula
has similiar structure. The difference is the left side of the formula: This must be the
List with objects
Output: Data frame with two columns: "cutoff" gives the different marker values and "tpr" the true positive rates
Input: A list of given argument input values (saved for reference). In addition there is the list element orderMarker
, which gives the indices of the marker values in increasing order.
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) summary(UnempDur$spell) # Extract subset of data set.seed(635) IDsample <- sample(1:dim(UnempDur)[1], 100) UnempDurSubset <- UnempDur [IDsample, ] head(UnempDurSubset) range(UnempDurSubset$spell) set.seed(7550) CVfolds <- createFolds (y=UnempDurSubset$spell, returnTrain=TRUE, k=2) # Estimate true positive rate of time interval 7: # Correspondes to three and a half month duration (each interval is of length two weeks) tryTPR <- tprUno (timepoint=7, dataSet=UnempDurSubset, trainIndices=CVfolds, survModelFormula=spell ~ age + logwage, censModelFormula=censor1 ~ 1, linkFunc="logit", idColumn=NULL) tryTPR plot(tryTPR)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.