Brier Score Calculation
Computes the brier score of each person based on a generalized, linear model with cross validation.
brierScore(dataSet, trainIndices, survModelFormula, linkFunc = "logit", censColumn, idColumn = NULL)
dataSet |
Original data in short format. Must be of class "data.frame". |
trainIndices |
Must be a list of indices used for training data sets. E. g. if a 10-fold cross validation should be conducted, then the list should have length 10 and in each element a integer vector of training indices. |
survModelFormula |
Gives the specified relationship of discrete response and covariates. The formula is designed, that the intercepts for the time dependent base line hazards are always included. Therefore only covariates should be given in this formula. This argument is required to be of class "formula". |
linkFunc |
Specifies the desired link function in use of generalized, linear models. |
censColumn |
Gives the column name of the event indicator (1=observed, 0=censored). Must be of type "character". |
idColumn |
Gives the column name of the identification number of each person. The argument must be of type "character". Default NULL means, that each row equals one person (no repeated measurements). |
At normal circumstances a covariate free model for the censoring weights is sufficient.
Numeric vector of brier scores for each person in the original data.
It is assumed that all time points up to the last interval [a_q, Inf) are available in short format. 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
Gerhard Tutz and Matthias Schmid, (2016), Modeling discrete time-to-event data, Springer series in statistics, Doi: 10.1007/978-3-319-28158-2
Gerds T. A. and M. Schumacher, (2006), Consistent estimation of the expected Brier score in general survival models with right-censored event times, Biometrical Journal, Vol. 48, No. 6, pages 1029-1040
# 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) # Calculate brier score tryBrierScore <- brierScore (dataSet=UnempDurSubset, trainIndices=CVfolds, survModelFormula=spell ~ age + logwage, linkFunc="logit", censColumn="censor1", idColumn=NULL) tryBrierScore
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.