Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

survstan (version 0.0.7.1)

residuals.survstan: residuals method for survstan models

Description

residuals method for survstan models

Usage

# S3 method for survstan
residuals(object, type = c("coxsnell", "martingale", "deviance"), ...)

Value

a vector containing the desired residuals.

Arguments

object

a fitted model object of the class survstan.

type

type of residuals desired: coxsnell (default), martingale and deviance.

...

further arguments passed to or from other methods.

Details

This function extracts the residuals, martingale residuals and deviance residuals of a survstan object.

Examples

Run this code
# \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