Maximum likelihood estimation of coefficients of one or more multinomial logit models.
Usage
## S3 method for class 'formula'
estimate.mlogit(f, data, method = "BHHH",
choices = NULL, base.choice = 1,
varying = NULL, sep = ".", ...)
## S3 method for class 'mnl.spec'
estimate.mlogit(object, data, method='BHHH', ...)
## S3 method for class 'bic.mlogit'
estimate.mlogit(object, ...)
## S3 method for class 'list'
estimate.mlogit(object, data, verbose=TRUE, ...)
Arguments
f
Formula as described in Details of mnl.spec.
object
An object of class mnl.spec containing the model specification, or an object of class bic.mlogit, or a list of objects of class mnl.spec.
data
Data frame containing the variables of the model.
method
Estimation method passed to the maxLik function of the maxLik package. Available methods are “Newton-Raphson”, “BFGS”, “BHHH”, “SANN” or “NM”.
choices
Vector of names of alternatives. If it is not given, it is determined from the response column of the data frame. Values of this vector should match or be a subset of those in the response column. If it is a subset, data is reduced to contain only observations whose choice is contained in choices.
base.choice
Index of the base alternative within the vector choices.
varying
Indices of variables within data that are alternative-specific.
sep
Separator of variable name and alternative name in the ‘varying’ variables.
verbose
Logical switching log messages on and off.
...
Arguments passed to the underlying optimization routine in optim. Note that arguments data and method can be also passed to estimate.mlogit.bic.mlogit and estimate.mlogit.list.
Details
The data are expected to be in the ‘wide’ format (using the terminology of the reshape function). There should be one record for each individual. Alternative-specific variables occupy single column per alternative.
The given optimization routine is called for the multinomial data, starting from the coefficients being all zeros.
Function estimate.mlogit.bic.mlogit invokes as many estimations as there are models selected in the bic.mlogit object. Function estimate.mlogit.list invokes an estimation for each specification included in the object argument.
Value
Functions estimate.mlogit.formula and estimate.mlogit.mnl.spec return an object of class mnl. Functions estimate.mlogit.bic.mlogit and estimate.mlogit.list return a list of such objects with each element corresponding to one specification. An object of class mnl contains the following components:
coefficients
The estimated coefficients.
logLik
Maximum log-likelihood.
logLik0
Null log-likelihood.
aic
Akaike Information Criterium.
bic
Bayesian Information Criterium.
iter
Number of iterations.
hessian
The Hessian at the maximum.
gradient
The last gradient value.
fitted.values
The MNL probabilities computed with the estimated parameters.
residuals
Difference between observed values and fitted values.
specification
The corresponding mnl.spec object.
convergence
Convergence statistics.
method
Estimation method.
time
Time needed for the estimation.
code
Code returned by the maxLik function.
message
Message describing the code.
last.step
List describing the last unsuccessful step if code=3 (see maxLik).
Author(s)
Hana Sevcikova
References
Train, K.E. (2003) Discrete Choice Methods with Simulation. Cambridge University Press.
See Also
summary.mnl, mnl.spec, reshape, maxLik
Examples
data(heating)
est <- estimate.mlogit(depvar ~ ic + oc, heating, choices=1:5,
varying=c(3:12, 20:24), sep='')
summary(est)