estimate.mlogit {mlogitBMA} | R Documentation |
Multinomial Logit Estimation
Description
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 |
object |
An object of class |
data |
Data frame containing the variables of the model. |
method |
Estimation method passed to the |
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, |
base.choice |
Index of the base alternative within the vector |
varying |
Indices of variables within |
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 |
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 |
convergence |
Convergence statistics. |
method |
Estimation method. |
time |
Time needed for the estimation. |
code |
Code returned by the |
message |
Message describing the |
last.step |
List describing the last unsuccessful step if |
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)