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

# st: GLLAMM 3-level model. Random coefficient at level 3. Syntax Help Please?

 From James Laurence To 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

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.

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/
```