0

I'm estimating a model about how people travel. 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')))
Zhaochen He
  • 610
  • 4
  • 12
  • Similar to this unanswered question here, except that I don't need 3 levels of nests. https://stackoverflow.com/questions/31231505/multistage-nested-logit-r – Zhaochen He Mar 02 '19 at 21:49
  • This does not appear to be a coding question but a modeling one. Consider other StackExchange sites: [CrossValidated](https://stats.stackexchange.com/) or [DataScience](https://datascience.stackexchange.com/). – Parfait Mar 02 '19 at 22:40
  • Thanks I'll re-post there. – Zhaochen He Mar 03 '19 at 23:56

1 Answers1

0

I found an answer to this situation in dealing with my own models. It DOES turn out to be a coding problem. You must include "unscaled=TRUE" when including "degenerate" nests of only one group. It's on p.35 of one of the versions of the vignette.

JOgawa
  • 23
  • 3