0
$\begingroup$

I'm estimating a model about how people travel in R. There are 4 alternatives: air, car, bus, and train. I want to create a nested logit model in which travelers first choose whether or not to fly, then, if they don't fly, choose between the remaining alternatives. Thus, my nests are (air) and (car, bus, train).

This article suggests that this procedure ought to be possible.

However, when I go to estimate this model, I find that it is singular unless each nest contains at least two items. It seems that there cannot be only one item in a nest, in contrast to the article above. Why is this?

Example:

#install.packages("AER")
data("TravelMode", package = "AER")

# Works fine
nl1 <- mlogit(choice ~ gcost + wait, TravelMode, shape = 'long', alt.var = 'mode', 
nests = list(public = c('train', 'air'), other = c('bus', 'car')))

# Gives singularity, as does any permutation with only one object in a nest
nl2 <- mlogit(choice ~ gcost + wait, TravelMode, shape = 'long', alt.var = 'mode', 
nests = list(public = c('air'), other = c('bus', 'car','train')))
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.