cumres.coxph {gof}R Documentation

Calculates GOF measures for Cox's propoportional hazard model for right censored survival times

Description

Currently only implemented for score processes which serves as tests for proportionaly of hazards.

Usage

## S3 method for class 'coxph':
cumres (model,
         variable=c(colnames(model.matrix(model))),
         type=c("score","residual"),
         R=500, plots=min(R,50), seed=round(runif(1,1,1e9)), ...)

Arguments

model Model object (lm or glm)
variable List of variable to order the residuals after
R Number of samples used in simulation
type Type of GOF-procedure
plots Number of realizations to save for use in the plot-routine
seed Random seed
... additional arguments

Value

Returns an object of class 'cumres'.

Author(s)

Klaus K. Holst and Thomas Scheike

References

Lin, D. Y. and Wei, L. J. and Ying, Z. (1993) Checking the Cox model with cumulative sums of martingale-based residuals Biometrika, Volume 80, No 3, p. 557-572.

Martinussen, Torben and Scheike, Thomas H. Dynamic regression models for survival data (2006), Springer, New York.

See Also

cumres.glm, coxph, and cox.aalen in the timereg-package for similar GOF-methods for survival-data.

Examples

library(survival)

simcox <- function(n=100, seed=1) {
  if (!is.null(seed))
    set.seed(seed)
  require(survival)
  time<-rexp(n); cen<-2*rexp(n); 
  status<-(time<cen); 
  time[status==0]<-cen[status==0]; 
  X<-matrix(rnorm(2*n),n,2)  
  return(data.frame(time=time, status=status, X))
}
n <- 100; d <- simcox(n); model <- coxph(Surv(time,status)~ X1 + X2, data=d, robust=TRUE)

dtimes <- sort(d$time[d$status==1])
system.time(a <- cumres(model))
summary(a)

## PBC example
data(pbc)
fit.cox <- coxph(Surv(time,status) ~ age + edema + bili + protime, data=pbc)
system.time(pbc.gof <- cumres(fit.cox,R=2000))
par(mfrow=c(2,2))
plot(pbc.gof, ci=TRUE, legend=NULL)


[Package gof version 0.6-2 Index]