residuals.survstan: residuals method for survstan models

View source: R/residuals.R

residuals.survstanR Documentation

residuals method for survstan models

Description

residuals method for survstan models

Usage

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

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.

Value

a vector containing the desired residuals.

Examples


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")


survstan documentation built on May 29, 2024, 8:41 a.m.