Calculates residuals for
flexsurvspline model fits.
## S3 method for class 'flexsurvreg' residuals(object, type = "response", ...)
Character string for the type of residual desired. Currently only
Not currently used.
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
Numeric vector with the same length as
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.