Calculate residuals for flexible survival models
Calculates residuals for flexsurvreg
or flexsurvspline
model fits.
## S3 method for class 'flexsurvreg' residuals(object, type = "response", ...)
object |
Output from |
type |
Character string for the type of residual desired. Currently only |
... |
Not currently used. |
Residuals of type = "response"
are calculated as the naive difference between the observed survival and the covariate-specific predicted mean survival from predict.flexsurvreg
, ignoring whether the event time is observed or censored.
Numeric vector with the same length as nobs(object)
.
fitg <- flexsurvreg(formula = Surv(futime, fustat) ~ age, data = ovarian, dist = "gengamma") residuals(fitg)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.