View source: R/residuals.flexsurvreg.R
residuals.flexsurvreg | R Documentation |
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.
type="coxsnell"
returns the Cox-Snell residual, defined as the estimated cumulative hazard at each data point. To check the fit of the
A more fully featured utility for this is provided in the function coxsnell_flexsurvreg
.
Numeric vector with the same length as nobs(object)
.
predict.flexsurvreg
fitg <- flexsurvreg(formula = Surv(futime, fustat) ~ age, data = ovarian, dist = "gengamma")
residuals(fitg, type="response")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.