Skip to contents

The martingale residuals symmetrised: \(d_i = \mathrm{sign}(M_i)\sqrt{-2[M_i + \delta_i\log(\delta_i - M_i)]}\), which is roughly standard normal under a correct model.

Usage

morie_deviance_residual_cox(fit)

Arguments

fit

a Cox fit, as for morie_cox_martingale_residuals.

Value

list with residuals, martingale, n_extreme (|d| > 2.5), mean, sd.

Details

Symmetry degrades under heavy censoring – a mass of small negative residuals is what censoring looks like, not lack of fit.

References

Therneau, T. M. and Grambsch, P. M. (2000). Modeling Survival Data, Sec. 4.5. Springer.

Examples

set.seed(1)
X <- matrix(rnorm(60), ncol = 1)
tt <- rexp(60, exp(X * 0.5))
f <- morie_efron_tie_correction(tt, rep(1, 60), X)
round(sd(morie_deviance_residual_cox(f)$residuals), 3)
#> [1] 0.998