Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multilevel model - random intercept / random slope model

    Hello. I am using the xtmixed command to run a multilevel model using cross-national survey data. My level 1 is the individual, and level 2 is the country. I could use a little help with the following issues.

    1) Is there a stata test/command that can determine if just the random intercept of random intercept+random slope model is better suited?
    2) When using cross level interactions, I read that one typically uses a random slope model. Is there any rule of thumb about when to use random slope vs. random intercept model in such a circumstance.
    3) When using a cross level interaction AND a random slope model, should the random effects portion always include the level 1 variable or under certain circumstances would it make sense to add the level 2 variable. For instance, is "a" always the right specification?

    a) xtmixed y c.xlevel1##c.xlevel2 || country: x_level1
    b) xtmixed y c.xlevel1##c.xlevel2 || country: x_level2


    4) Is there any stata test/command to figure out what type of covariance to use?

    Any help would be appreciated!

    Thank you,
    Gene Park

  • #2
    FIrst, if you are using current Stata (and you're supposed to tell us in your post if you are not) the command has been renamed -mixed-. Stata will still respond to -xtmixed-, but I believe in doing so it uses the older default options as well.

    Question 1. You have to run both models, store the estimates after each, and then do a likelihood ratio test (-lrtest-). If you are not familiar with -estimates store- and -lrtest-, do read the corresponding manual sections.

    Question 2. I think you do not understand what is meant by cross-level interaction. A cross-level interaction is a random slope. The fact that variable x1 varies across values of both level1 and level2 and variable x2 is constant within values of level2 does not make x1##x2 a cross-level interaction. It's just an interaction between variables defined at different levels. A cross level ineraction is precisely what you model when you include a random slope at level2 on x1.

    Question 3. As already noted, a cross-level interaction is a random slope model. The level1 variable must be mentioned both in the "fixed effects" part of the equation, and in the random effects. Thus if you want a cross-level interaction of x1 with country, the correct specification is:
    Code:
    mixed y x1 || country: x1
    The underlying model is y = b0 + b*x1 + u_country + epsilon, where b = c0 + v_country, where v_country is constant within country and is a random variable with a zero-centered normal distribution.

    You can also have a validly specified model:
    Code:
    mixed y c.x1##c.x2 || country: x1
    but that is a very different model. There the underlying model is:
    y = b0 + b*x1 + b2*x2 + b3*x1*x2 + u_country + epsilon, where b = c0 + v_country, and v_country is, again, constant within country, having a zero-centered normal distribution.

    As for covariance structure, in most situations nobody really cares about the covariance structure anyway. Evidently, the ID and Independent structures impose the strongest constraints, with exchangeable being a bit weaker assumption. The unstructured covariance imposes no constraints at all, but if you have more than just a handful of random effects at any level, the number of parameters needed to estimate this model blows up rapidly and you quickly find yourself running up against convergence problems. So most people use either independent (the default in most models) or exchangeable. Exchangeable is particularly well suited to repeated measures modeling. If, however, the degree of correlation between two random effects actually needs to be estimated to achieve the research goals, then you have to use unstructured and keep your fingers crossed.

    Comment


    • #3
      Thank you so much, Clyde, for such a clear answer. All best, Gene

      Comment

      Working...
      X