\HeaderA{stat.anova}{GLM Anova Statistics}{stat.anova}
\keyword{regression}{stat.anova}
\keyword{models}{stat.anova}
\begin{Description}\relax
This is a utility function, used in \code{lm} and
\code{glm} methods for \code{\LinkA{anova}{anova}(..., test != NULL)}
and should not be used by the average user.
\end{Description}
\begin{Usage}
\begin{verbatim}
stat.anova(table, test = c("Chisq", "F", "Cp"), scale, df.scale, n)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{table}] numeric matrix as results from
\code{\LinkA{anova.glm}{anova.glm}(..., test=NULL)}.
\item[\code{test}] a character string, matching one of \code{"Chisq"},
\code{"F"} or \code{"Cp"}.
\item[\code{scale}] a residual mean square or other scale estimate to be used
as the denominator in an F test.
\item[\code{df.scale}] degrees of freedom corresponding to \code{scale}.
\item[\code{n}] number of observations.
\end{ldescription}
\end{Arguments}
\begin{Value}
A matrix which is the original \code{table}, augmented by a column
of test statistics, depending on the \code{test} argument.
\end{Value}
\begin{References}\relax
Hastie, T. J. and Pregibon, D. (1992)
\emph{Generalized linear models.}
Chapter 6 of \emph{Statistical Models in S}
eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{anova.lm}{anova.lm}}, \code{\LinkA{anova.glm}{anova.glm}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
##-- Continued from '?glm':

print(ag <- anova(glm.D93))
stat.anova(ag$table, test = "Cp",
           scale = sum(resid(glm.D93, "pearson")^2)/4, df = 4, n = 9)
\end{ExampleCode}
\end{Examples}

