\Header{plot.cox.zph}{Graphical Test of Proportional Hazards}
\keyword{survival}{plot.cox.zph}
\begin{Description}\relax
Displays a graph of the scaled Schoenfeld residuals, along with a smooth curve.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'cox.zph':
plot(x, resid=TRUE, se=TRUE, df=4, nsmo=40, var, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] result of the \code{cox.zph} function.

\item[\code{resid}] a logical value, if \code{TRUE} the residuals are included on the plot, as well as the smooth fit.

\item[\code{se}] a logical value, if \code{TRUE}, confidence bands at two standard errors
will be added.

\item[\code{df}] the degrees of freedom for the fitted natural spline, \code{df=2} leads
to a linear fit.

\item[\code{nsmo}] number of points used to plot the fitted spline.

\item[\code{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.

\item[\code{...}] additional arguments passed to the \code{plot} function.

\end{ldescription}
\end{Arguments}
\begin{Section}{Side Effects}
a plot is produced on the current graphics device.
\end{Section}
\begin{SeeAlso}\relax
\code{\Link{cox.zph}}, \code{\Link{coxph}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(veteran)
vfit <- coxph(Surv(time,status) ~ trt + factor(celltype) +
              karno + age, data=veteran, x=TRUE)
temp <- cox.zph(vfit)
plot(temp, var=5)      # Look at Karnofsy score, 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")
\end{ExampleCode}
\end{Examples}

