Martingale residuals are helpful for detecting the correct functional form of a continuous predictor in a survival model. A mathematical definition of Martingale like residuals for the Accelerated Failure Time model (which is a parametric survival model) can be found in Collett’s 2003 book *Modelling survival data in medical research*. The R code implements Collett’s approach to Martingale residuals for the AFT model.

Continue reading R code for Martingale residuals of a parametric survival model