multinom(formula, data, weights, subset, na.action,
contrasts = NULL, Hess = FALSE, summ = 0, censored = FALSE,
model = FALSE, ...)
response ~ 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 coeffiformula
.C
); method 3 also combines rows
with the same X and different Y, which changes the baseline for the
deviance.K
columns, interpret the entries as one
for possible classes, zero for impossible classes, rather than as
counts.model
of the returned object.nnet
nnet
object with additional components:Hess
is true).model
is true).multinom
calls nnet
. The variables on the rhs of
the formula should be roughly scaled to [0,1] or the fit will be slow
or may not converge at all.nnet
options(contrasts = c("contr.treatment", "contr.poly"))
library(MASS)
example(birthwt)
(bwt.mu <- multinom(low ~ ., bwt))
Run the code above in your browser using DataLab