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]
Re: st: RE: question on nested logit
From
"Data Analytics Corp." <[email protected]>
To
[email protected]
Subject
Re: st: RE: question on nested logit
Date
Mon, 03 Sep 2012 16:28:56 -0400
Sorry. I forgot to include the signature;
Walt
________________________
Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
[email protected]
www.dataanalyticscorp.com
_____________________________________________________
On 9/3/2012 2:57 PM, Lachenbruch, Peter wrote:
do you have a name other than Walt? See FAQ about submitting anonymously
Peter A. Lachenbruch,
Professor (retired)
________________________________________
From: [email protected] [[email protected]] On Behalf Of Data Analytics Corp. [[email protected]]
Sent: Monday, September 03, 2012 10:09 AM
To: [email protected]
Subject: st: question on nested logit
Hi,
I'm experimenting with the nested logit setup for a coffee demand study
I want to do. Here's a sample of the data:
+-----------------------------------------------------------------------------------------------------+
| id choice form flavor size price brandc~e
brand FLAVORX FORMX SIZEX |
|-----------------------------------------------------------------------------------------------------|
1. | 1 0 BagGr UnLgt 16 2.25 4 Folgers
UNFLAVORED BAGGED MEDIUM |
2. | 1 0 BagWh UnMed 20 3 7 SBUX
UNFLAVORED BAGGED LARGE |
3. | 1 0 Can UnDK 18 2.75 6
Classico UNFLAVORED CANNED MEDIUM |
4. | 1 0 Pods Hazel 10 3.1 1
DD FLAVORED PODS SMALL |
5. | 1 0 InstCan Van 24 1.75 8 Store
FLAVORED INSTANT LARGE |
|-----------------------------------------------------------------------------------------------------|
6. | 1 0 InstSt Other 4 2.5 5 Peet
FLAVORED INSTANT SMALL |
7. | 1 0 Mix UnLgt 12 3.25 3
Maxwell UNFLAVORED MIXES MEDIUM |
8. | 1 1 Liq UnMed 8 1.5 2 Godiva
UNFLAVORED LIQUID SMALL |
9. | 2 0 BagGr UnDK 16 2.25 4
Folgers UNFLAVORED BAGGED MEDIUM |
10. | 2 0 BagWh Hazel 20 3 7 SBUX
FLAVORED BAGGED LARGE |
+-----------------------------------------------------------------------------------------------------+
The data are read from a text file using a Do File which also creates
the nested logit tree:
#delimit ;
insheet using "C:\Temp\coffee.txt", clear;
label drop _all;
nlogitgen FLAVORX = flavor(UNFLAVORED: UnLgt | UnMed | UnDK, FLAVORED:
Hazel | Van | Other);
nlogitgen FORMX = form(BAGGED: BagGr | BagWh, CANNED: Can, INSTANT:
InstCan | InstSt, MIXES: Mix, LIQUID: Liq, PODS: Pods);
nlogitgen SIZEX = size(SMALL: 4 | 8 | 10, MEDIUM: 12 | 16 | 18, LARGE:
20 | 24);
nlogittree brand FORMX FLAVORX SIZEX, choice(choice);
Stata returns an error message:
. nlogittree brand FORMX FLAVORX SIZEX, choice(choice);
invalid tree structure; input bottom level first
r(198);
Why? No matter how I arrange FORMX, FLAVORX, and SIZEX, I get an
error. I want brand to be at the bottom of the tree and it's specified
first, as it should be. Everything seems correct. But obviously I'm
missing something. Any help?
I'm using Stata 11 on a Windows PC.
Thanks,
Walt
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/