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 3-level model. Random coefficient at level 3. Syntax Help Please?


From   James Laurence <[email protected]>
To   <[email protected]>
Subject   st: GLLAMM 3-level model. Random coefficient at level 3. Syntax Help Please?
Date   Wed, 21 Nov 2012 17:26:00 +0000

Dear Statalist,

I have a question regarding the use of gllamm for multi-level modelling of ordinal variables.

A brief description of my data and aim. 


I have individuals nested in schools nested in cities i.e. 3-levels. My dependent variable is 4-options from 1 to 4 on levels of satisfaction i.e. it is ordinal. My key independent variables are: individual (level-1) disadvantage; level of school (level-2) disadvantage; and level of city (level-3) disadvantage.

My main aim is to test whether the effect of school disadvantage on individual's satisfaction is dependent on/moderated by the level of disadvantage in a city in which the school is "nested" i.e. whether there is an interaction effect between school (level-2) disadvantage AND city (level-3) disadvantage, after controlling for individual-level (level 1) disadvantage. So I want to include a level-2 * level-3 interaction in the model.

Crucially, my outcome is ordinal so, as far as I have been able to tell from reading, I have to use gllamm along with the link(ologit) function.

So, I believe I need to use a random-coefficient model where the effect of "school disadvantage" (at level 2) is allowed to have different coefficients at (level 3). 

So, here is the syntax I was thinking of using, where school(lvl2)disad*city(lvl3)disad is the level2 * level3 interaction term.

generate cons = 1
eq inter: cons
eq slope: school_disad(lvl2)

gllamm satis(lvl1) individual_disad(lvl1) school_disad(lvl2) city_disad(lvl3) school(lvl2)disad*city(lvl3)disad, i(school_ID city_ID) adapt link(ologit) nip(10) nrf(1 2) eqs(inter inter slope)

Does this look right? In particular:

- I've had trouble working out the nrf() values. I used nrf(1 2) as I am specifying one random-effect at level-2 (i.e. a random-intercept for school_lvl2) AND two random-effects at level-2 (i.e. a random-intercept and -coefficient for city_lvl3)

- Is the eqs() option specified correctly. I used eqs(inter inter slope) because of random-intercept at level-2 and random-intercept and random-coefficient at level-3


All advice would be hugely appreciated.

Thanks so much in advance,

Jamie Lorenz





 		 	   		  
*
*   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