I am trying to use nested logit specification for estimating school choice of households. The first branch may be explained as - if the student currently attends school, the question of choosing between government and private schools arises. The other branch is degenerate i.e. not attending school.


tree structure specified for the nested logit model

type N school N k
-----------------------------------
attend 77902 --- gov 38951 20534
+- pvt 38951 7648
no attend38951 --- n 38951 10769
-----------------------------------
total 116853 38951

I have used the stata code

nlogitgen type= school(yes: gov|pvt, no: n)
constraint 1 [no_tau]_cons=1

nlogit choose monthavfee|| type: mpce, base(no)|| school:, noconstant case(id) constraint(1)

However, on including an alternate invariant regressor 'logtuiexp' in the main regression, which is average private tuition cost, which does not vary across school choice, the command does not work. This is not a household/individual specific variable but remains invariant across choices (does not vary across individuals(j) and choices (k))

nlogit choose monthavfee logtuiexp|| type: mpce, base(no)|| school:, noconstant case(id) constraint(1)
variable logtuiexp is not alternative-specific: it has no within-case variability
r(459);


This is the error I am getting. Any suggestion would be really helpful for me.


Thanks in advance

Sayoree Gooptu