Deviance Residuals
Computes the root of the deviance residuals for evaluation of performance in discrete survival analysis. A generalized, linear model is used for prediction.
devResid(dataSet, survModelFormula, censColumn, linkFunc = "logit", idColumn = NULL)
dataSet |
Original data in short format. Must be of class "data.frame". |
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". |
censColumn |
Gives the column name of the event indicator (1=observed, 0=censored). Must be of type "character". |
linkFunc |
Specifies the desired link function in use of generalized, linear models. |
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). |
Output: List with objects:
DevResid: Square root of deviance residuals as numeric vector.
GlmFit: Fit object of class (generalized, linear model used in the calculations)
Input: A list of given argument input values (saved for reference)
Thomas Welchowski welchow@imbie.meb.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
Gerhard Tutz, (2012), Regression for Categorical Data, Cambridge University Press
library(Ecdat) # Example with cross validation and unemployment data data(UnempDur) summary(UnempDur$spell) # Extract subset of data set.seed(635) IDsample <- sample(1:dim(UnempDur)[1], 100) UnempDurSubset <- UnempDur [IDsample, ] # Calculate deviance residuals for the unemployment data subset devianceResiduals <- devResid (dataSet=UnempDurSubset, survModelFormula=spell ~ age + logwage, censColumn="censor1", linkFunc="logit", idColumn=NULL) devianceResiduals
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.