\HeaderA{anova.coxph}{Analysis of Deviance for Cox model.}{anova.coxph}
\aliasA{anova.coxphlist}{anova.coxph}{anova.coxphlist}
\keyword{models}{anova.coxph}
\keyword{regression}{anova.coxph}
\keyword{survival}{anova.coxph}
\begin{Description}\relax
Compute an analysis of deviance table for one Cox model fit.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'coxph':
anova(object, ...,  test = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An object of class \code{coxph}
\item[\code{...}] Further \code{coxph} objects
\item[\code{test}] a character string, (partially) matching one of \code{"Chisq"},
\code{"F"} or \code{"Cp"}. See \code{\LinkA{stat.anova}{stat.anova}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Specifying a single object gives a sequential analysis of deviance
table for that fit.  That is, the reductions in the residual deviance
as each term of the formula is added in turn are given in as
the rows of a table, plus the residual deviances themselves.


If more than one object is specified, the table has a row for the
residual degrees of freedom and deviance for each model. For all
but the first model, the change in degrees of freedom and deviance
is also given. (This only make statistical sense if the models are
nested.)  It is conventional to list the models from smallest to
largest, but this is up to the user.

The table will optionally contain test statistics (and P values)
comparing the reduction in deviance for the row to the residuals.
Mallows' \eqn{C_p}{Cp} statistic is the residual
deviance plus twice the  residual degrees of freedom, which is closely
related to AIC. Don't use \code{test=F}, it doesn't make sense.
\end{Details}
\begin{Value}
An object of class \code{"anova"} inheriting from class \code{"data.frame"}.
\end{Value}
\begin{Section}{Warning}
The comparison between two or more models by \code{anova} or
will only be valid if they
are fitted to the same dataset. This may be a problem if there are
missing values.
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{coxph}{coxph}}, \code{\LinkA{anova}{anova}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fit <- coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian) 
anova(fit)
anova(fit,test="Chisq")
fit2 <- coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data
=ovarian)
anova(fit2,fit)
 \end{ExampleCode}
\end{Examples}


