Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Define nested logit with many choices
From
Mauricio Esteban Cuak <[email protected]>
To
[email protected]
Subject
st: Define nested logit with many choices
Date
Wed, 31 Jul 2013 11:56:37 -0500
Hi,
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 **********
clear
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,
ME
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/