Description Usage Arguments Details Value Author(s) References See Also Examples
Cox-Snell residuals of the survreg.aft
fit.
1 2 |
fit |
|
plot |
returns residual plot if |
xlim |
x limits (x1, x2) of the plot (optional). |
ylim |
y limits of the plot (optional). |
main |
main title of the plot (optional). |
Plot of the Cox-Snell (hazard-based) residuals should be roughly a straight line with unit slope when the model is adequate. See Section 6.2 of Lawless and Section 3.7.3 of Cook and Lawless for details.
residuals
Cox-Snell residuals.
plot
residual plot if plot=TRUE
.
Shahedul Khan <khan@math.usask.ca>
Cook RJ and Lawless J, The statistical analysis of recurrent events, Springer, 2007.
Lawless J, Statistical models and methods for lifetime data, Wiley, 2003.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Example 1: Recurrent Event Analysis
library(frailtypack)
data(readmission)
# Recoding sex and chemo
sex<-factor(2-as.numeric(readmission$sex),
labels=c("Female","Male"))
chemo<-factor(as.numeric(readmission$chemo)-1,
labels=c("NonTreated","Treated"))
Data<-readmission
Data$sex<-sex
Data$chemo<-chemo
fit.gg<-survreg.aft(c(t.start,t.stop,event)~sex+chemo+charlson,
Data=Data,model="ggamma")
fit.w<-survreg.aft(c(t.start,t.stop,event)~sex+chemo+charlson,
Data=Data,model="weibull")
surv.resid(fit.w)
par(mfrow=c(1,2))
surv.resid(fit.w,plot=TRUE,xlim=c(0,4.75),ylim=c(0,4.75),main="Weibull")
surv.resid(fit.gg,plot=TRUE,xlim=c(0,4.75),ylim=c(0,4.75),main="Generalized Gamma")
# Example 2: Non-recurrent Data (Right Censored)
library(survival)
fit.ll<-survreg.aft(c(time,status)~karno+diagtime+age+prior+celltype+trt,
Data=veteran,model="llogistic")
surv.resid(fit.ll,plot=TRUE,main="Log-logistic")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.