residuals.coxph_mpl function

Residuals for a Cox model

Residuals for a Cox model

Compute martingale and Cox and Snell residuals for a model fitted by coxph_mpl. Return objects are of class residuals.coxph_mpl and have methods for plot. utf8

## S3 method for class 'coxph_mpl' residuals(object, ...) ## S3 method for class 'residuals.coxph_mpl' plot(x, ask=TRUE, which=1:2, upper.quantile=.95, ...)

Arguments

  • object: an object inheriting from class coxph_mpl, representing a fitted Cox proportional hazard model.

  • x: an object inheriting from class residuals.coxph_mpl, representing the residuals of a Cox proportional hazard model fit with coxph_mpl.

  • ask: logical. If TRUE, the user is asked to hit the enter keyboard

    before each plot. See par(ask=.). Default is ask=TRUE.

  • which: integer vector indicating the list of wished plots. If a subset of the plots is required, specify a subset of the numbers 1:2. See Details . By default, all plots are provided.

  • upper.quantile: quantile of the Cox and Snell residuals used when which==3. Default is upper.quantile=.95.

  • ...: other parameters to be passed through to plotting or printing functions.

Details

Refer to Collet (2003, Chapter 4) for a review of model check in the Cox regression model, and specifically to Farrington (2000) for an overview on residuals with interval-censored survival data.

For object of class residuals.coxph_mpl, the available residual plots are, respectively, the martingale residual plot (which==1) and the Cox and Snell residual plot (which==2).

Returns

A data.frame of class residuals.coxph_mpl of nn rows with following columns: 'time1', the model outcome (with a random noise added to event ties if ties=='epsilon' in coxph_mpl.control); 'time2', ending time of the interval for interval censored data only (unused otherwise); 'censoring', the status indicator as in the Surv() function, i.e. 0=right censored, 1=event at time, 2=left censored, 3=interval censored; 'coxsnell', the Cox and Snell residuals; 'martingale', the martingale residuals.

See Also

coxph_mpl, coxph_mpl.control, coxph_mpl.object, predict.coxph_mpl and summary.coxph_mpl.

References

Farrington C.P. (2000), Residuals for Proportional Hazard Models with Interval-Censored Data, Biometrics 56, 473-482.

Collett, D. (2003), and Moeschberger, M. L. (2003), Modelling Survival Data in Medical Research, Chapman and All.

Author(s)

Dominique-Laurent Couturier, Maurizio Manuguerra

Examples

## Not run: ### lung data of the survival package (see ?lung) data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) par(mfrow=c(1,2)) plot(residuals(fit_mpl), which=1:2, ask=FALSE) ## End(Not run)
  • Maintainer: Dominique-Laurent Couturier
  • License: LGPL (>= 2)
  • Last published: 2025-03-24

Useful links