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: mixlogit
From
Ragnhild Røhme fjærtoft <[email protected]>
To
[email protected]
Subject
st: mixlogit
Date
Fri, 20 Sep 2013 11:43:34 +0200
Hello,
I have two problems related to estimating a multinomial logit model
with unobserved heterogeneity by the command mixlogit in Stata12 as
done in Arne Hole’s paper in The Stata Journal (2007) 7, Number 3.
I have an unbalanced data panel covering the years 1999-2007 with
doctors as observation units. There is one record for each doctor in
the years they are observed. In each year the doctors can chose
between four different practice types, defined by the variable
job_port which takes on values 1-4 after choice of practice type.
Idnr identifies the doctors while year identifies the time of choice.
I have only individual-specific variables
My first problem relates to the preparation of the dataset for it to
be suitable for using with mixlogit. I set choice alternative one as
the reference alternative. I get the error message; "At least one
group has more than one chosen alternative". I do not get this message
when running separate regressions for each year.
I do the following;
expand 4
by idnr year, sort:gen alt=_n
gen choice=alt==job_port
gen a2=(alt==2)
gen a3=(alt==3)
gen a4=(alt==4)
I then construct variables for each alternative, here exemplified with
three explanatory variables age (the doctors age), male (dummy for
being male) and married (dummy for being married)
gen a2male=a2*male
gen a3male=a3*male
gen a4male=a4*male
gen a2age=a2*age
gen a3age=a3*age
gen a4age=a4*age
gen a2married=a2*married
gen a3married=a3*married
gen a4married=a4*married
I the use the following syntax to run the model
mixlogit choice a2male a3male a4male a2age a3age a4age a2married
a3married a4married, group(idnr) rand(a2 a3 a4) id(year)
My second problem relates to estimation the final coefficients when
the random intercepts are correlated
After running the model (separate regressions for each year), I type
matrix b=b(e)
In Hole’s article, the next step is to compute a matrix which in the article is
matrix b = b[1,1..5],0,b[1,6]. I struggle to adapt the computation of
this matrix to my data.
I would highly appreciate answers to my problems.
Best regards
Ragnhild Røhme Fjærtoft
*
* 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/