Learn R Programming

mlogitBMA (version 0.1-2)

estimate.mlogit: 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 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
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
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.

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:
  • coefficientsThe estimated coefficients.
  • logLikMaximum log-likelihood.
  • logLik0Null log-likelihood.
  • aicAkaike Information Criterium.
  • bicBayesian Information Criterium.
  • iterNumber of iterations.
  • hessianThe Hessian at the maximum.
  • gradientThe last gradient value.
  • fitted.valuesThe MNL probabilities computed with the estimated parameters.
  • residualsDifference between observed values and fitted values.
  • specificationThe corresponding mnl.spec object.
  • convergenceConvergence statistics.
  • methodEstimation method.
  • timeTime needed for the estimation.
  • codeCode returned by the maxLik function.
  • messageMessage describing the code.
  • last.stepList describing the last unsuccessful step if code=3 (see maxLik).

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.

References

Train, K.E. (2003) Discrete Choice Methods with Simulation. Cambridge University Press.

See Also

summary.mnl, mnl.spec, reshape, maxLik

Examples

Run this code
data(heating)
est <- estimate.mlogit(depvar ~ ic + oc, heating, choices=1:5, 
                       varying=c(3:12, 20:24), sep='')
summary(est)

Run the code above in your browser using DataLab