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]

Re: st: Nested Logit Model

From   "Alvarez,Sergio" <>
To   <>
Subject   Re: st: Nested Logit Model
Date   Wed, 02 Nov 2011 14:09:52 -0400


It sounds like you need to create the alternatives. Remember that you need an observation for each choice at the terminal end of the tree. If you give more info on how your data is organized we may be able to help some more.

Here's a helpful link:

Usually the data we have access to records only the actual choice, and it is up to the researcher to create the alternative choices, and to create a binary variable that indicates whether the choice was made or not.

It would also be good to try and run a conditional logit first; you'll know if your data are in the right format before you start going into setting up the nested logit.

Hope it helps,


On Wed, 2 Nov 2011 13:20:02 -0300, Luis Felipe Correa Smits wrote:
Dear All,

I’m quite new to stata so I don’t know If I have a command or database
issue. So here I go:

I’m trying to solve a model for my thesis dissertation on the
probability for a pharmacy to enter and then locate in a Chilean
district. My ideal tree should be:

          /              \
        /                  \
      /                       \
Enter                Not Enter
   |                    /        |    \
   |                  /          |      \
   |                /            |        \
   0     Location=1       …      N

I generated the nlgoit tree with the district=0 for the decision not
to enter the industry, and all the observed districts for the decision
to enter (nlogitgen type=district (No: 0, Yes: 1|…|N). Then I
generated the “chosen” variable based on whether there’s a pharmacy on
the district or not.

Then I tried to run the regression (nlogit   chosen
number_of_stores_pharmacy_chain1    number_of_stores_pharmacy_chain2
type_of_competitor_base_on_distance[inmediate; nearby; far away]
population_between_0_to_5_years_old population_more_than_65_years_old
 median_rent  district_area[sq miles] business_density||type:
income_per_capita urban_population rural_population||district:,

But I get:
note: 334 cases (1336 obs) dropped due to no positive outcome or
multiple positive outcomes per case
no cases remain after removing invalid observations

I don’t know what I’m doing wrong. Can anyone help me please?


Best Regards

Felipe Correa

*   For searches and help try:

Sergio Alvarez
Food and Resource Economics
University of Florida
*   For searches and help try:

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