Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Generating outcome variable for a Nested Logit Model

From   Iria Puyosa <>
Subject   st: Generating outcome variable for a Nested Logit Model
Date   Thu, 15 Sep 2005 13:06:33 -0400

This is my first time attempting to fit a Nested Logit model in Stata 9. Im
having trouble trying to make it work. I would appreciate if you can help me
to fix it.

The tree structure in my outcome variable should be the following:
PSE enrollment
Level 1:  Enrolled  No Enrolled
Level 2 (for Enrolled): Enrolled in 2years  Enrolled in 4years.

The syntax Im writing is the following:

. nlogitgen Enroll_PSE = enroll (no_enrolled: 1, enrolled: 3|4, 2years: 3,
4years: 4);

This is the message Stata produces:

new variable Enroll_PSE is generated with 4 groups
label list lb_Enroll_PSE
           1 no_enrolled
           2 enrolled
           3 2years
           4 4years

This is the tree structure, Stata is generating from my commands:

.  nlogittree Enroll_PSE;
tree structure specified for the nested logit model

        top --> bottom


Then, if I try to specify the model in the contextual menu window, there are
not alternative variables for me to select neither at level 1 nor at level

If I try writing the nlogit regression syntax in the Editor, I get the
following message:

outcome does not vary in any group

For error 2000 the Help says:
. . . . . . . . . . . . . . . . . . . . . . . . Return code 2000
        no observations;
        You have requested some statistical calculation and there are
        no observations on which to perform it.  Perhaps you specified
        if exp or in range and inadvertently filtered all the data.

Please, help me to identify the mistakes Im making generating the outcome


Iria Puyosa
Center for the Study of Higher and Post-Secondary Education (CSHPE)
/ PhD student
University of Michigan

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index