Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: multinomial multilevel random intercept model using gllamm


From   "Julia Korosteleva" <j.korosteleva@ucl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: multinomial multilevel random intercept model using gllamm
Date   Mon, 22 Aug 2011 15:32:42 +0100

Greetings,

I am terribly sorry for disturbing you but I would appreciate your help
with my model. I am currently running a 3-level random intercept
multinomial model with
respondents denoting level 1; years - level 2; and countries - level 3.

I?ve first deleted all cases with missing values. I then collapsed the
dataset and created level 1 weights to speed up the
estimations as per advice provided in the gllamm manual. For this used all
the varaibles that are appear in the regression. Is it correct?

collapse (count) wt1=cons, by(year country  l3r_hfgov l3_exconst
l3_finfree l_dgdp l_gdp_pc_ppp SUYR5JOBml2 age age_sq male gemwork
educ_secpost educ_post busang_dum omestb_dum knowent_dum fearfail_dum)

Next I created a  new variable  - alternatives correspondent to each of
the 3 options of the dependent variable.

sort year country  SUYR5JOBml2

here year represents level 2, country ? level 3 and SUYR5JOBml2 is my
dependent variable which represents start-up growth expectations and it
contains 3 responses: (1) don?t enter entrepreneurship; (2) enter
self-employment; (3) enter entrepreneurship with intentions to  generate
employment (more than 1 job in 5 years time).

I further created an ID variable for the dataset.

gen id=_n
expand 3
sort id
qui by id: gen alt=_n
gen chosen=alt== SUYR5JOBml2
tab alt, gen(a)
eq a2: a2
eq a3: a3

However at this stage I have a major concern. I am not entirely sure
whether I do everything correctly in expanding the data by replacing each
record with 3 replicates and generating a new variable alt. If the total
No of obs after deletion of cases with missing values is about 450,000 I
don?t really understand why a number of observations for the new variable 
alt expands to 586,818 and why the final No of obs goes up to
1,430,000. Could you please explain in more detail how this ?expanded?
option works and advise on whether I expand the data correctly based on
the syntax above.

. tab alt, gen(a)

        alt |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |    195,606       33.33       33.33
          2 |    195,606       33.33       66.67
          3 |    195,606       33.33      100.00
------------+-----------------------------------
      Total |    586,818      100.00

Below is the model itself. I have a number of level 1 characteristics of
start-ups to predict the odds of choosing a specific alternative (out of
the 3 mentioned earlier). Further I have level 2 variables which are
lagged values of the institutional indicators (e.g. l3rhfgov stands for
the 3?rd lag of the size of the state and so on).

. gllamm alt age age_sq male gemwork educ_secpost educ_post busang_dum
omestb_dum knowent_dum fearfail_dum l3r_hfgov l3_exconst l3_finfree l_dgdp
l_gdp_pc_ppp, expand(id chosen m) i(year country) link(mlogit)
family(binom) eqs(a2 a3) nip(4) weight(wt) adapt trace dots

When I add the 'nrf' option I can onyl specify (1, 1) which I believe is
not exactly correct as I need to random effects to be displayed for each
level so to have (2, 2). However, I get a warning message when I try to do
this. Furthermore, I wonder whether I also need to add an overall constant
so to have 'eq const' and then to specify nrf(2, 2, 2). So, so far I've
taken out nrf option form the model allowing it to be a default one (1,1)
which would show ransom intercept one of the response only.

Below are seom preliminary information on the estimation of the model for
more details.

gllamm alt age age_sq male gemwork educ_secpost educ_post busang_dum
omestb_dum knowent_dum fearfail_dum l3r_hfgo
> v l3_exconst l3_finfree l_dgdp l_gdp_pc_ppp, expand(id chosen m) i(year
country) link(mlogit) family(binom) eqs(a
> 2 a3) nip(4) weight(wt) adapt trace dots

General model information
------------------------------------------------------------------------------

dependent variable:         alt
nominal responses:          mlogit
denominator:                1
equations for fixed effects
                           c2:  age age_sq male gemwork educ_secpost
educ_post busang_dum omestb_dum knowent_dum fe
> arfail_dum l3r_hfgov l3_exconst l3_finfree l_dgdp l_gdp_pc_ppp _cons
                           c3:  age age_sq male gemwork educ_secpost
educ_post busang_dum omestb_dum knowent_dum fe
> arfail_dum l3r_hfgov l3_exconst l3_finfree l_dgdp l_gdp_pc_ppp _cons


Random effects information for 3 level model
------------------------------------------------------------------------------



***level 2 (year) equation(s):
   (1 random effect(s))

   standard deviation for random effect 1
   yea1_1 : a2


***level 3 (country) equation(s):
   (1 random effect(s))

   standard deviation for random effect 2
   cou2_1 : a3



number of level 1 units = 1430103
number of level 2 units = 187
number of level 3 units = 51

Initial values for fixed effects

(using gllamm for inital values)

In the zero iteration all coefficients were '0'. Now I am at iteration 5
after 12 hrs of the model running. Please advise if I am doing everything
correctly.

The last thing. I've also tried to estimate the model without expanding
the dataset and leaving the origianl dependent variable denoting 3
alternatives.

 gllamm SUYR5JOBml2 age age_sq male gemwork educ_secpost educ_post
busang_dum omestb_dum knowent_dum fearfail_dum l3r_hfgov l3_exconst
l3_finfree l_dgdp l_gdp_pc_ppp, i(year country) link(mlogit)
family(binom) basecategory(1) nip(4) adapt trace dots

This one is stuck at iteration 1 without no further progress after 14 hrs
of running. Odd enough, when I started running this specification a few
days ago and after 1 day I discovered that there was not much progress
after iteration 0 I stopped running it. Once I broke it I got the results
of iteration 1 appearing on the screen and the following message followed:
"conformability error finish running on 22 Aug 2011 at 03:12:22". Do you
think it is worth giving another go? I've re-launched it again but as I
mentioned earlier after 14 hrs I still get onyl iteration 0, and for some
reasons I cannot see dots to judge whether the programme crashed or not.

Please also advise which of the two specifications would be preferable.

Many thanks,
Julia

-- 
Dr Julia Korosteleva
Lecturer in Business Economics
Affiliate Tutor
School of Slavonic and East European Studies
University College London
16 Taviton Street
London, WC1H 0BW
Tel.: 020 76797590
Fax: 020 7679 8755
E-mail: J.Korosteleva@ucl.ac.uk


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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index