Statalist


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

st: xtmixed and multilevel models


From   "Tomas Lind" <[email protected]>
To   <[email protected]>
Subject   st: xtmixed and multilevel models
Date   Sun, 20 Dec 2009 17:27:47 +0100

Dear listers,

I am a bit confused about the number of levels in a multilevel model. In
Stata v 10 manual XT page 293 (xtmixed). In example 4 they describe a "2
level model" with individuals, states and regions. To me it looks like a 3
level model. What´s going on?

I can´t find any example in xtmixed-regression with explanatory variables on
a group level (for example on level 2 in a 2-level model). If I want to
explain why a random intercept varies between group 2 units because of
differences in socioeconomic status between groups do I proceed like this?

I generate a new variable to the dataset "group_mean_ses" which is the mean
ses within group. All individuals in a group have the same value.

Now I add the variable group_mean_ses as an explanatory variable in the
xtmixed model (don´t worry over the variables, this is not a real study).

xtmixed  health  age  sex  ses   group_mean_ses  ||  group


If I have a random slope on some individual level variable, say age, and
want to explain that with group_mean_ses should I generate a cross-level
interaction variable.

generate gmsXage = group_mean_ses * age

and then specify the model as

xtmixed  health  age  sex  ses   group_mean_ses  gmsXage  ||  group : age


All comments or ideas are welcome.


/Tomas







*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index