The function mblogit
fits multinomial logit models for categorical
and multinomial count responses with fixed alternatives, where the logits are
relative to a baseline category.
mblogit(formula, data = parent.frame(), subset, weights = NULL,
na.action = getOption("na.action"), model = TRUE, x = FALSE, y = TRUE,
contrasts = NULL, control = mclogit.control(...), ...)
the model formula. The response must be a factor or a matrix of counts.
an optional data frame, list or environment (or object
coercible by as.data.frame
to a data frame) containing
the variables in the model. If not found in data
, the
variables are taken from environment(formula)
,
typically the environment from which glm
is called.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of weights to be used in the fitting
process. Should be NULL
or a numeric vector.
a function which indicates what should happen
when the data contain NA
s. The default is set by
the na.action
setting of options
, and is
na.fail
if that is unset. The ‘factory-fresh’
default is na.omit
. Another possible value is
NULL
, no action. Value na.exclude
can be useful.
a logical value indicating whether model frame should be included as a component of the returned value.
logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value.
an optional list. See the contrasts.arg
of model.matrix.default
.
a list of parameters for the fitting process.
See mclogit.control
arguments to be passed to mclogit.control
mblogit
returns an object of class "mblogit", which has almost the
same structure as an object of class "glm". The difference are
the components coefficients
, residuals
, fitted.values
,
linear.predictors
, and y
, which are matrices with
number of columns equal to the number of response categories minus one.
The function mblogit
internally rearranges the data
into a 'long' format and uses mclogit.fit
to compute
estimates. Nevertheless, the 'user data' is unaffected.