
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the nested logit model, a choice model that does not satisfy the independence of irrelevant alternatives (iia) property. The model is particularly useful for analyzing structured choice situations where alternatives can be grouped into comparable categories. An example of the nested logit model application using stata and explains the concept of inclusive value parameter and its estimation using full information maximum likelihood.
Typology: Exams
1 / 24
This page cannot be seen from the preview
Don't miss anything!

















i
i
. list family_id restaurant chosen kids rating distance cost income in 1/
+---------------------------------------------------------------------------------+
| family~d restaurant chosen kids rating distance cost income |
|---|
| 1 WingsNmore 0 1 2 6.330531 9.667909 39 |
|---|
. nlogitgen type=restaurant(fast: Freebirds | MamasPizza, family: CafeEccell | LosNortenos | WingsNmore, fancy: Christophers | MadCows)
This returns: new variable type is generated with 3 groups label list lb_type lb_type: 1 fast 2 family 3 fancy
. nlogittree restaurant type <-GIVES US THE TREE STRUCTURE. Type is the branch; restaurants are the "twigs."
tree structure specified for the nested logit model
top --> bottom
fast Freebirds MamasPizza family CafeEccell LosNorte~s WingsNmore fancy Christop~s MadCows
For fun.
. nlogit chosen (restaurant= cost rating distance) (type = incFast incFancy kidFast kidFancy), group(family_id) nolog ivc(fast=1, family=1, fancy=1) notree <---CONSTRAINING TAU TO 1 User-defined constraints: IV constraints: [fast]_cons = 1 [family]_cons = 1 [fancy]_cons = 1 Nested logit regression Levels = 2 Number of obs = 2100 Dependent variable = chosen LR chi2(7) = 189. Log likelihood = -488.90834 Prob > chi2 = 0.
| Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- restaurant | cost | -.1367799 .0358479 -3.82 0.000 -.2070404 -. rating | .3066626 .1418291 2.16 0.031 .0286827. distance | -.1977508 .0471653 -4.19 0.000 -.2901931 -. -------------+---------------------------------------------------------------- type | incFast | -.0390182 .0094018 -4.15 0.000 -.0574454 -. incFancy | .0407053 .0080405 5.06 0.000 .0249462. kidFast | -.2398756 .1063674 -2.26 0.024 -.4483517 -. kidFancy | -.3893868 .1143797 -3.40 0.001 -.6135669 -. -------------+---------------------------------------------------------------- (incl. value | parameters) | type | /fast | 1..... /family | 1..... /fancy | 1.....
Constraining tau=1 should recover conditional logit:
. clogit chosen cost rating dist incFast incFancy kidFast kidFancy, group(family_id) Conditional (fixed-effects) logistic regression Number of obs = 2100 LR chi2(7) = 189. Prob > chi2 = 0. Log likelihood = -488.90834 Pseudo R2 = 0.
chosen | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cost | -.1367799 .0358479 -3.82 0.000 -.2070404 -. rating | .3066622 .1418291 2.16 0.031 .0286823. distance | -.1977505 .0471653 -4.19 0.000 -.2901927 -. incFast | -.0390183 .0094018 -4.15 0.000 -.0574455 -. incFancy | .0407053 .0080405 5.06 0.000 .0249462. kidFast | -.2398757 .1063674 -2.26 0.024 -.448352 -. kidFancy | -.3893862 .1143797 -3.40 0.001 -.6135662 -.
(And it does; verify from previous slide)
Where do the numbers come from? xbb: Linear prediction for the bottom level
It’s a function of the covariates cost, rating, and distance. For the first observation, we see this is:
. display _b[cost]cost+_b[rating]rating+_b[distance]*distance -.
condpb: Conditional probability of restaurant j given branch i (from equation on previous slide):
. display exp(-.731619)/(exp(-.731619)+exp(-.8987747)) .
for "FreeBirds" and
. display exp(-.8987747)/(exp(-.731619)+exp(-.8987747)) .
for "MamasPizza."
xb1: Linear prediction for i branch
This is the linear prediction for the top-level model (or the branches):
. display -.0287502incFast + .0458373incFancy + -.0704164kidFast + -.3626381kidFancy -1.