Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Three level nested logit

    Hi,

    I'm trying to run a nested logit using three levels with -nlogit-.

    Level 1 is whether the individual participates or not, denoted by P.

    Level 2 is achieved if P=1, and has two major occupation levels, denoted by the dummy B.

    Level 3 is achieved if B=0, and has 4 options under it.

    I can't find any three level example online.

    Can someone tell me what the nlogitgen and nlogit commands should look like please?

    ​​​​​

  • #2
    So I ran the following:

    gen twig=0 if P==0
    replace twig=1 if P==1 & B==0
    replace twig=2 if P==1 & B==1
    replace twig=3 if P==1 & B==2
    replace twig=4 if P==1 & B==3

    nlogitgen type=twig(Nonparticipant: 0, Particpant: 1 | 2 | 3 | 4 (B1: 1, B2: 2 | 3 | 4))
    nlogittree twig type


    However, now B1 has two branches instead of 1, and B2 has 2 instead of three. Somehow twig=4 has been assigned to B1.
    Anyone knows how to fix this?
    Last edited by Alina Faruk; 14 Apr 2019, 09:27.

    Comment

    Working...
    X