Learn R Programming

mlogit (version 0.1-0)

mlogit: Multinomial logit model

Description

Estimation by maximum likelihood of the multinomial logit model, with choice-specific and/or individual specific variables.

Usage

mlogit(formula, data, weights = NULL, ...)
## S3 method for class 'mlogit':
print(x, digits = max(3, getOption("digits") - 2),
    width = getOption("width"), ...)
## S3 method for class 'mlogit':
summary(object, ...)
## S3 method for class 'summary.mlogit':
print(x, digits = max(3, getOption("digits") - 2),
    width = getOption("width"), ...)
## S3 method for class 'mlogit':
print(x, digits = max(3, getOption("digits") - 2),
    width = getOption("width"), ...)
## S3 method for class 'mlogit':
logLik(object, ...)
## S3 method for class 'mlogit':
vcov(object, ...)

Arguments

x, object
an object of class mlogit
formula
a symbolic description of the model to be estimated,
data
the data,
weights
an optional vector of weights,
digits
the number of digits,
width
the width of the printing,
...
further arguments.

Value

  • An object of class "mlogit", a list with elements coefficients, logLik, hessian, gradient, call, est.stat, residuals and fitted.values.

Details

Let J being the number of alternatives. The formula may include choice-specific and individual specific variables. For the latter, J-1 coefficients are estimated for each variable. Choice and individual specific variables are separated by a |. For example, if x1 and x2 are choice specific and z1 and z2 are individual specific, the formula y~x1+x2|z1+z2 describe a model with one coefficient for x1 and x2 and J-1 coefficients for z1 and z2. J-1 intercepts are also estimated. A model without intercepts is defined by the formula : y~x1+x2-1|z1+z2. To obtain alternative specific coefficients for the choice-specific variable x2, use : y~x1+x2+x2:alt|z1+z2 (replace alt by the relevant variable name if the alternative index is provided. Models with only choice-specific or individual-specific variables are respectively estimated by y~x1+x2 and y~1|z1+z2.

The model is estimated with the maxLik package and the Newton-Raphson method, using analytic gradient and hessian.

References

McFadden, D. (1973) Conditional logit analysis of qualitative choice behavior, in P. Zarembka ed., Frontiers in Econometrics, New-York: Academic Press. McFadden, D. (1974) ``The Measurement of Urban Travel Demand'', Journal of Public Economics, 3, pp. 303-328. Train, K. (2004) Discrete Choice Modelling, whith Simulations, Cambridge University Press.

See Also

mlogit.data to shape the data. multinom from package nnet performs the estimation of the multinomial logit model with individual specific variables

Examples

Run this code
# Heating data, from the Ecdat package
data("Heating",package="Ecdat")

# Heating is a "horizontal" data.frame with three choice-specific
# variables (ic: investment cost, oc: operating cost) and some
# individual-specific variables (income, region, rooms)
Heatingh <- mlogit.data(Heating,cvar=c(ic=3,oc=8,pb=17),
                       shape="hor.var",choice="depvar")

# a model with two choice-specific variables
summary(mlogit(depvar~ic+oc,data=Heatingh))

# same wihtout intercept
summary(mlogit(depvar~ic+oc-1,data=Heatingh))

# a model with choice-specific and individual-specific variables
summary(mlogit(depvar~ic+oc|income+rooms,data=Heatingh))

# a model with choice-specific coefficients for a choice-specific variable
summary(mlogit(depvar~ic+oc+oc:alt,data=Heatingh))

# a model with only individual-specific variables
summary(mlogit(depvar~1|income+rooms,data=Heatingh))

# the same model estimated with multinom from the nnet package
library(nnet)
summary(multinom(depvar~income+rooms,data=Heating))

Run the code above in your browser using DataLab