residuals method for survstan models
# S3 method for survstan
residuals(object, type = c("coxsnell", "martingale", "deviance"), ...)
a vector containing the desired residuals.
a fitted model object of the class survstan.
type of residuals desired: coxsnell (default), martingale and deviance.
further arguments passed to or from other methods.
This function extracts the residuals, martingale residuals and deviance residuals of a survstan object.
# \donttest{
library(survstan)
ovarian$rx <- as.factor(ovarian$rx)
fit <- aftreg(Surv(futime, fustat) ~ age + rx, data = ovarian, baseline = "weibull", init = 0)
residuals(fit, type = "coxsnell")
residuals(fit, type = "martingale")
residuals(fit, type = "deviance")
# }
Run the code above in your browser using DataLab