Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: gllamm multinomial logit


From   [email protected]
To   [email protected]
Subject   st: gllamm multinomial logit
Date   Mon, 30 Apr 2007 11:52:07 -0600

Dear all,

I am trying to run a two-level multinomial random-intercept model that includes level-2 covariates.

What I have is a dependent variable Y which takes 3 nominal values and X1 & X2 are level-1 control variables and Z1 & Z2 are level-2 variables where the intercept is a function of Z1 and Z2. AREA is a geographical identification variable.

I am wondering if anyone can evaluate the following gllamm syntax. In particular, I am not quite sure if coefficients on Z1 and Z2 really represents effects of Z1 and Z2 on latent variable (intercept).

Any comments will be greatly appreciated.

-----
sort AREA X1 X2 Y Z1 Z2
gen patt=_n
expand 3
sprt patt
qui by patt: gen dep=_n
gen chosen=dep==Y
sort patt dep
tab dep, gen(a)

gen a2_X1=a2*X1
gen a3_X1=a3*X1
gen a2_X2=a2*X2
gen a3_X2=a3*X2
gen a2_Z1=a2*Z1
gen a3_Z1=a3*Z1
gen a2_Z2=a2*Z2
gen a3_Z2=a3*Z2

eq a2: a2
eq a3: a3

gllamm dep a2_X1 a2_X2 a2_Z1 a2_Z2 a3_X1 a3_X2 a3_Z1 a3_Z2, i(AREA) nrf(2) eq (a2 a3) expand(patt chosen o) lin(mlogit) fam(binom) nip(4) adapt trace
---------

end of syntax


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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