\Header{multinom}{Fit Multinomial Log-linear Models}
\alias{add1.multinom}{multinom}
\alias{anova.multinom}{multinom}
\alias{coef.multinom}{multinom}
\alias{drop1.multinom}{multinom}
\alias{extractAIC.multinom}{multinom}
\alias{model.frame.multinom}{multinom}
\alias{predict.multinom}{multinom}
\alias{print.multinom}{multinom}
\alias{print.summary.multinom}{multinom}
\alias{summary.multinom}{multinom}
\alias{vcov.multinom}{multinom}
\keyword{neural}{multinom}
\keyword{models}{multinom}
\begin{Description}\relax
Fits multinomial log-linear models via neural networks.\end{Description}
\begin{Usage}
\begin{verbatim}
multinom(formula, data = parent.frame(), weights, subset, na.action,
         contrasts = NULL, Hess = FALSE, summ = 0, censored = FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] a formula expression as for regression models, of the form
\code{response \textasciitilde{} predictors}. The response should be a factor or a
matrix with K columns, which will be interpreted as counts for each of
K classes.
A log-linear model is fitted, with coefficients zero for the first
class. An offset can be included: it should be a matrix with K columns
if the response is a matrix with K columns or a factor with K > 2
classes, or a vector for a factor with 2 levels.
See the documentation of \code{\Link{formula}()} for other details.

\item[\code{data}] an optional data frame in which to interpret the variables occurring
in \code{formula}.

\item[\code{weights}] optional case weights in fitting.

\item[\code{subset}] expression saying which subset of the rows of the data should  be used
in the fit. All observations are included by default.

\item[\code{na.action}] a function to filter missing data.

\item[\code{contrasts}] a list of contrasts to be used for some or all of
the factors appearing as variables in the model formula.

\item[\code{Hess}] logical for whether the Hessian (the observed/expected information matrix)
should be returned.

\item[\code{summ}] integer; if non-zero summarize by deleting duplicate rows and adjust weights.
Methods 1 and 2 differ in speed (2 uses \code{C}); method 3 also combines rows
with the same X and different Y, which changes the baseline for the
deviance.

\item[\code{censored}] If Y is a matrix with \code{K > 2} columns, interpret the entries as one
for possible classes, zero for impossible classes, rather than as
counts.

\item[\code{...}] additional arguments for \code{nnet}

\end{ldescription}
\end{Arguments}
\begin{Value}
A \code{nnet} object with additional structure.

\begin{ldescription}
\item[\code{deviance}] the residual deviance.

\item[\code{edf}] the (effective) number of degrees of freedom used by the model

\item[\code{AIC}] the AIC for this fit.

\item[\code{Hessian}] (if \code{Hess} is true).

\end{ldescription}
\end{Value}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.\end{References}
\begin{SeeAlso}\relax
\code{\Link{nnet}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
options(contrasts = c("contr.treatment", "contr.poly"))
library(MASS)
example(birthwt)
(bwt.mu <- multinom(low ~ ., bwt))
## Don't run: Call:
multinom(formula = low ~ ., data = bwt)

Coefficients:
 (Intercept)         age         lwt raceblack raceother
    0.823477 -0.03724311 -0.01565475  1.192371 0.7406606
     smoke      ptd        ht        ui       ftv1     ftv2+
  0.7555234 1.343648 1.913213 0.6802007 -0.4363238 0.1789888

Residual Deviance: 195.4755
AIC: 217.4755
## End Don't run
\end{ExampleCode}
\end{Examples}

