Displays a graph of the scaled Schoenfeld residuals, along with a smooth curve.
USAGE:
plot.cox.zph(x, resid=T, se=T, df=4, nsmo=40, var, ...)
REQUIRED ARGUMENTS:
x
result of the
cox.zph function.
OPTIONAL ARGUMENTS:
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.
...
additional arguments passed to the
plot function.
SIDE EFFECTS:
a plot is produced on the current graphics device.
SEE ALSO:
,
.
EXAMPLES:
veteran <- data.frame(cancer.vet)
vfit <- coxph(Surv(survival,status) ~ therapy + factor(celltype)
+ Karn..score + age, data=veteran, x=T)
temp <- cox.zph(vfit)
# Look at Karnofsy score:
plot(temp, var=5) # Old way of doing plot
plot(temp[5]) # New way with subscripting
abline(0, 0, lty=3)
# Add the linear fit as well:
abline(lm(temp$y[,5] ~ temp$x)$coefficients, lty=4, col=3)
title(main="VA Lung Study")