Skip to contents

Standardised residuals \(z = (\log t - x'\beta)/\sigma\), Cox-Snell residuals \(-\log S(z)\), and the martingale and deviance forms built from them.

Usage

morie_aft_residuals(fit)

Arguments

fit

a fit from one of the AFT fitters.

Value

list with standardized, cox_snell, martingale, deviance, event, family.

Details

The Cox-Snell residuals are the reason to bother: under ANY correctly specified parametric family they are a censored sample from the unit exponential, so one plot of their Nelson-Aalen cumulative hazard against themselves checks Weibull, log-logistic and log-normal with the same picture. Departure from the 45-degree line is misfit.

References

Cox, D. R. and Snell, E. J. (1968). A general definition of residuals. JRSS-B, 30(2), 248-265.

Examples

if (requireNamespace("ranger", quietly = TRUE)) {
  set.seed(2)
  X <- matrix(rnorm(200), ncol = 2)
  tt <- exp(0.5 + X %*% c(0.8, -0.4) - 0.7 * log(rexp(100)))
  f <- morie_aft_weibull(tt, rep(1, 100), X)
  round(mean(morie_aft_residuals(f)$cox_snell), 2)
}
#> [1] 1