prop.coxph: Checking proportional hazards assumption for Cox model

Description Usage Arguments Details Value Author(s) References Examples

Description

Diagnostics for proportional hazards of specific covariate(s) of the Cox model. The limiting null distribution of the score process is approximated using either Lin's method (1993) or Liu's (2008). P-values are derived for KS, CvM and AD statistics.

Usage

1
2
## S3 method for class 'coxph'
prop(model, variable=NULL, type.test=c("Lin"), R=1000, plots=min(R,50), seed=NULL,...)

Arguments

model

Model object (coxph).

variable

Vector corresponding to the labels of each covariate. This is also an output argument.

type.test

Type of approximation. Values are "Lin" or "Liu". Default is "Lin".

R

Generation number used for Monte-Carlo simulations. This is also an output argument.

plots

Realizations number of Monte-Carlo simulations to save for use in the plot-routine.

seed

Random seed.

...

additional arguments.

Details

- The same type of function was proposed in gof package (cumres.coxph) at the difference that the autors only used Lin's method to approximate the limiting null distribution of the score process.

- A prop.cph function accepting models of cph type (rms package) is also included in the package, and uses the same arguments as prop.coxph. Contrary to prop.coxph, the use of 'x=TRUE' option for covariates design is now required in cph model. Strata and cluster options are not supported.

Value

Returns an object of class 'scproc'. The main items of this object are :

obs

m x p matrix of unique times. m is the length of unique times.

W

The process U(\widehat{β},t).

What

The simulated limiting processes for the R-plots first Monte-Carlo realizations.

sdw

Standard error over time of What.

cvalues

R x p matrix whose components are the supremum of the standardized What process for each Monte-Carlo realization . The quantiles of this output argument are used to calculate the prediction bands in the plot-routine.

KS

Vector of the p rejection probabilities using KS type statistic.

CvM

Vector of the p rejection probabilities using CvM type statistic.

AD

Vector of the p rejection probabilities using AD type statistic.

Author(s)

Patrick Sfumato and Jean-Marie Boher.

References

Holst KK (2014). gof: Model-diagnostics based on cumulative residuals. R package version 0.9.1, URL https://CRAN.R-project.org/package=gof.

Lin DY, Wei JL and Ying Z (1993).Checking the Cox model with cumulative sums of martingale-based residuals. Biometrika, 80(3), 557-572.

Liu M, Lu W and Shao (2008). A Monte Carlo approach for change-point detection in the Cox proportional hazards model. Statistics in Medecine, 27(19), 3894-3909.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require(survival)
  
#Simulating survival data
simcox <- function(n=100, seed=1) {
  if (!is.null(seed))
  set.seed(seed)
  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); 
  
#Fitting Cox's model
fit.coxph <- coxph(Surv(time,status)~ X1 + X2, data=d)
  
#Checking the proportional hazards assumption
prop(fit.coxph) 

Example output

Loading required package: survival
Loading 'goftte' version 1.0.3

Rejection p-values associated to Lin's approximation for proportional hazards assumption
---
Kolmogorov-Smirnov-test: p-value=0.206
Cramer-von-Mises-test: p-value=0.159
Anderson-Darling-test: p-value=0.192
Based on 1000 realizations. Cumulated residuals ordered by X1-variable.
---
Kolmogorov-Smirnov-test: p-value=0.252
Cramer-von-Mises-test: p-value=0.29
Anderson-Darling-test: p-value=0.306
Based on 1000 realizations. Cumulated residuals ordered by X2-variable.
---

goftte documentation built on May 2, 2019, 5:12 a.m.