Skip to contents

Diagnostic Cox-Snell residual plot for a fitted AFT or cure model. Under a correctly specified model the residuals behave like a unit exponential sample, so the Kaplan-Meier estimate of their cumulative hazard should follow the 45-degree line.

Usage

# S3 method for class 'bd_aft'
plot(x, ...)

# S3 method for class 'bd_cure'
plot(x, ...)

Arguments

x

A fitted `"bd_aft"` or `"bd_cure"` object.

...

Further graphical parameters passed to `plot`.

Value

Invisibly returns `x`.

Examples

# \donttest{
set.seed(42)
n <- 300
xcov  <- stats::rnorm(n)
k_i   <- exp(-0.5 - 0.3 * xcov)
t_sim <- rbetadanish(n, a = 1, b = 2, c = 1.5, k = k_i)
dat   <- data.frame(time = t_sim,
                    status = stats::rbinom(n, 1, 0.85),
                    x = xcov)
fit <- fit_bd_aft(survival::Surv(time, status) ~ x, data = dat, n_starts = 5)
plot(fit)

# }