fcov.coxph: Checking the functional form assumption for Cox model

Description Usage Arguments Details Value Author(s) References Examples

Description

Diagnostics for the linear functional form of specific covariate(s) of the Cox model. The method is based on Lin's approximation of the randomly pertubed sum process (1993). Another approximation method recommended by Liu (2008) is also proposed. P-values are derived for supremum KS test statistics.

Usage

1
2
3
## S3 method for class 'coxph'
fcov(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

A fcov.cph function accepting models of cph type (rms package) is also included in the package, and uses the same arguments as coxph. Contrary to fcov.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

l x p matrix of unique covariates values for functional form. l is the maximum number of unique observations between the p covariates.

W

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

What

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

sdw

Standard error over covariates values 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.

Author(s)

Patrick Sfumato and Jean-Marie Boher.

References

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 model
fit.coxph <- coxph(Surv(time,status)~ X1 + X2, data=d)
  
#Checking the covariates functional form assumption
fcov(fit.coxph) 

Example output

Loading required package: survival
Loading 'goftte' version 1.0.5

Rejection p-values associated to Lin's approximation for covariate(s) functional form assumption
---
Kolmogorov-Smirnov-test: p-value=0.857
Based on 1000 realizations. Cumulated residuals ordered by X1-variable.
---
Kolmogorov-Smirnov-test: p-value=0.768
Based on 1000 realizations. Cumulated residuals ordered by X2-variable.
---

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