plot.cox.zph: Graphical Test of Proportional Hazards

Description Usage Arguments Details Note Examples

Description

Displays a graph of the scaled Schoenfeld residuals, along with a smooth curve.

Usage

1
2
3
## S3 method for class 'cox.zph'
plot(x, resid = TRUE, se = TRUE, df = 4, nsmo = 40,
  var, smoothcol = "black", confcol = smoothcol, ...)

Arguments

x

result of the cox.zph function.

resid

a logical value, if TRUE the residuals are included on the plot, as well as the smooth fit.

se

a logical value, if TRUE, confidence bands at two standard errors will be added.

df

the degrees of freedom for the fitted natural spline, df=2 leads to a linear fit.

nsmo

number of points used to plot the fitted spline.

var

the set of variables for which plots are desired. By default, plots are produced in turn for each variable of a model. Selection of a single variable allows other features to be added to the plot, e.g., a horizontal line at zero or a main title.

This has been superseded by a subscripting method; see the example below.

smoothcol

color for the smooth fit line

confcol

color for the upper/lower confidence interval lines

...

additional graphical arguments passed to the plot function.

Details

This is an augmented version of the survival::plot.cox.zph function that allows for specifying separate colors for the smooth fit line and confidence interval lines

Note

Load this pacakge AFTER the survival pacakge.

Examples

1
2
3
4
5
library(survival)
vfit <- coxph(Surv(time,status) ~ trt + factor(celltype) +
              karno + age, data=veteran, x=TRUE)

plot(cox.zph(vfit))

hrbrmstr/gghazard documentation built on May 17, 2019, 5:08 p.m.