plot.cox.zph {survival4}R Documentation

Graphical test of proportional hazards

Usage

plot.cox.zph(x, resid=T, se=T, df=4, nsmo=40, var)

Arguments

x result of the cox.zph function.
resid include the residuals on the plot, as well as the smooth fit.
se if true, confidence bands at 2 standard errors will be added.
df the degrees of freedom for the fitted natural spline. A df value of 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.

Side Effects

a plot is produced on the current graphics device.

See Also

cox.zph, coxph

Examples

data(veteran)
vfit <- coxph(Surv(time,status) ~ trt + factor(celltype) + karno +age,
		   data=veteran, x=T)
temp <- cox.zph(vfit)
plot(temp, var=5)      #Look at Karnofsy score
abline(0,0, lty=3)
abline( lm( temp$y[,5] ~ temp$x), lty=4)   #Add the linear fit as well
title(main="VA Lung Study")


[Package Contents]