Statalist The Stata Listserver

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

st: modelling cross-level effects in gllamm

From   Inna Khousnoullina <>
Subject   st: modelling cross-level effects in gllamm
Date   Sun, 03 Sep 2006 20:03:17 +0200

Dear Stas Kolesnikov,

thank you very much for your help concerning the modeling of interaction
effects in multi-level models using gllamm.
> Typically in econometrics, you would use the product of the variables
> to model the interaction. In multilevel modeling, you model this by
> saying, "The slopes are my level-2 outcomes, and I want to model the
> slope for x1 using z1". Thus you would need to specify -eqs- with the
> equation that would have a constant and z1, and your model will have
> two random effects, both augmented with z1: a random intercept and a
> random slope for x1.

This is great for the solution of the product of the two variables was
just for not knowing how to model these effects using gllamm.
Unfortunately I do not know how to use the -eqs- command for modeling
this  cross-level effect (with an additional random slope). Is the
following syntax correct?

gen cons=1
eq inter:cons
eq slope: x1*z1

eq slope: z1
or eq slope: x1 z1

but how does gllamm know with which variable z1 should interact?

glamm y x1 x2 x3 z1, family(binomial) link(logit) i(state) nrf(2)
eqs(inter slope) adapt

The way you've used -gllamm- in the way you've
> given, it is equivalent to -xtlogit, re-, but probably a few times
> slower.

Yes, but unfortunately I'm still working with STATA 8.2. :(

 If you really hate random slopes models, you can try to
> constrain the variance of the second random effect to zero,

How can I do this? I'm interested in estimating one model without a
random slope and one with it and then testing whether the second model
does better.

but then
> the covariance between the two random effects is underidentified, and
> the model may fail to converge.

Is this a permanent threat of multi-level models with no random slopes
but cross-level effects?

Again many thanks for help

Inna Khousnoullina

*   For searches and help try:

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