Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Define nested logit with many choices

From   Mauricio Esteban Cuak <>
Subject   st: Define nested logit with many choices
Date   Wed, 31 Jul 2013 11:56:37 -0500


I'm considering a problem with around 200 alternatives and around 4
nests each with, say, 50 alternatives.

Consider the example in the help with the built-in dataset restaurant.dta

****** Begin Code **********
version 12
webuse restaurant.dta

nlogitgen type = restaurant(fast: Freebirds | MamasPizza, family:
CafeEccell | LosNortenos | WingsNmore, fancy:
            Christophers | MadCows)

nlogit chosen cost distance rating || type: income kids, base(family)
|| restaurant:, noconst case(family_id)

****** End Code *************

Suppose however, that I want to define the nests by the variable
"rating" (by which restaurants are classified), so that each nests
contains all restaurants that have rating == x.
In this particular case, it is easy to list all the restaurants that
fit a certain rating, but what if I have (like in my case) 50
restaurants per rating level?

I can manually input those restaurant names per category, but there
must be an easier and less error prone way!
Thanks for your time,

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index