mclogit
fits conditional logit models and mixed conditional
logit models to count data and individual choice data,
where the choice set may vary across choice occasions.Conditional logit models without random effects are fitted by Fisher-scoring/IWLS. The implementation of mixed conditional logit currently is limited to PQL and random intercepts.
mclogit(formula, data=parent.frame(), random=NULL,
subset, weights, offset=NULL, na.action = getOption("na.action"),
model = TRUE, x = FALSE, y = TRUE, contrasts=NULL,
start.theta=NULL,
control=mclogit.control(...), ...)
as.data.frame
to a data frame) containing
the variables in the model. If not found in data
, the
variables NULL
or a numeric vector.NA
s. The default is set by
the na.action
setting of options
, and is
contrasts.arg
of model.matrix.default
.mclogit.control
mclogit.control
mlogit
returns an object of class "mlogit", 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.mlogit
tries first to fit the model using the IRLS algorithm of
glm.fit
, which has the advantage that
starting values are not needed in most cases. If convergence
cannot achieved, it tries to minimize the deviance using
optim
with method "BFGS".data(Transport)
summary(mclogit(
cbind(resp,suburb)~distance+cost,
data=Transport
))
data(electors)
summary(mclogit(
cbind(Freq,interaction(time,class))~econ.left/class+welfare/class+auth/class,
random=~1|party.time,
data=within(electors,party.time<-interaction(party,time))))
Run the code above in your browser using DataLab