Bookmark and Share

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]

st: gllamm, multilevel conditional logit


From   <[email protected]>
To   <[email protected]>
Subject   st: gllamm, multilevel conditional logit
Date   Mon, 25 Nov 2013 15:12:17 +0000

Dear Users,
I'm using -gllamm expand() link(mlogit)-  with Stata13 and getting a result I know is wrong, so I know I'm misunderstanding something with the equation-specification.

I have data on educational track decision, including alternative-specific and case-constant variables on individual and regional level, and would like to use gllamm to estimate a 3-level discrete choice model with fixed-effects and random effects on individual and region-level. So far I have just found stata-syntax on British election data from Skrondal & Rabe-Hesketh (2004, http://www.gllamm.org/books/readme.html#13.4, Model M23(c)), which comes close to what I would like to do.

My data is in long form and consists for each student 3 rows for the 3 educational alternatives/modes (track1, track2, track3), from which students had to choose one, as well as a dummy-variable choice, which indicates the chosen track by the student. I use 2 alternative-specific variables (as1, as2) as well as case constant variables for egp-class and math-grades on individual-level and 2 variables on the region-level (reg1, reg2).

I first fitted single-level models without the variables on the region-level using asclogit and gllamm with the syntax below - the results are identical and in line with theory:

asclogit choice as1 as2 , casevars(math egp2 egp34 egp567) ///
                case(id) alternative(alt)  basealternative(1) vce(cluster id) nolog

gllamm alt as1 as2 ///
       alt2Xmath alt2Xegp2 alt2Xegp34 alt2Xegp567 alt2 ///
       alt3Xmath alt3Xegp2 alt3Xegp34 alt3Xegp567 alt3 ///
       i(id) link(mlogit) expanded(id choice o) noconstant cluster(id) robust init

The second step would now be to estimate a 3-level conditional logit-model, including fixed-effects for alternative and case-constant variables and a random part on the  student and region-level: 

eq gam1: alt2 
eq gam2: alt3

gllamm alt as1 as2 ///
       alt2Xreg1 alt2Xreg2 alt2Xmath alt2Xegp2 alt2Xegp34 alt2Xegp567 alt2 ///
       alt3Xreg1 alt3Xreg2 alt3Xmath alt3Xegp2 alt3Xegp34 alt3Xegp567 alt3 ///
       i(id region) noconstant ///
       nrf(2 2) eq(gam1 gam2 gam1 gam2) ///
                expanded(id choice o) f(binom) link(mlogit) adapt trace

Questions:
1. I am not sure whether I have to include the alternative-specific constant variables (alt2, alt3) in the model, when I also use them in the equation-specification? If I do not, some of the fixed-effects estimates change their direction and are no longer in line with theory and expectations.
2. I am not sure whether I really need a 3-level model, since the data on the chosen track is clustered within students. Because in gllamm the cluster-option is only available on the highest hierarchy-level, I so far cannot see a solution to estimate a model with clustered-student information on level 1 and a region-information on level 2.

I would be very thankful for comments on my gllamm-syntax and questions.
Kind regards
David



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index