Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

Re: st: xtmixed: Cross-level interaction only with random coefficients?

 From Clyde B Schechter To "statalist@hsphsun2.harvard.edu" Subject Re: st: xtmixed: Cross-level interaction only with random coefficients? Date Fri, 26 Oct 2012 16:06:24 +0000

```First, a reminder that posters are asked to show their complete real names.

Somebody using the alias "enfinity@web.de" has inquired why most examples of multilevel models he or she finds in books or on the internet include a random coefficient, such as:

xtmixed y level1 level2 level1Xlevel2 || country: level1, nolog covar(un)  // (1)

and asks what is wrong with

xtmixed y level1 level2 level1Xlevel2 || country: , nolog covar(un) //  (2)

Well, as for "most examples," I suspect there is something about the sample of books and web sites "enfinity" visits that accounts for this.  My personal experience (which may be a differently biased sample) is that there are lots of examples of random intercept but not random coefficient models.

There is _nothing wrong_ with a model like (2) from a statistical perspective.  It's a question of the science and what is going on.  The two models make different assumptions about the data generating process, and in any given problem either may be a better approach than the other.

In a random coefficient model like (1) you are positing that the slope of y as a function of level1 differs from one country to the next and you are trying to estimate the variance among countries of those slopes.  In model (2) you are assuming that there is a single slope of y as a function of level1 that characterizes the relationship between y and level1 in _all_ countries, though the y vs level1 graphs may differ in their "vertical" placement from one country to the next (that's what the random intercept captures).

Which of these models makes more sense depends on what y and level1 are and which type of relationship is produced by whatever mechanisms generate the data.  If there is no pre-existing theory to guide the choice of models, it is probably best to start with some graphical exploration of the data to see which looks better.  Also, computationally, random slope models are, in my experience, more prone to convergence problems when you try to estimate them (especially if, in fact, the variance of the random slope is very small).  So if there is no theoretical basis for assuming the slope varies across units of analysis and the graphical evidence doesn't suggest that happens either, it is probably safer to stick to a random intercept model.

Clyde Schechter
Department of Family & Social Medicine
Albert Einstein College of Medicine
Bronx, New York, USA

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