Announcement

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

  • Fitting Random Slope in Mixed Models

    Greetings Experts,

    I use stata version 15.0. I have longitudinal data that I am trying to fit some mixed models. My outcome is distance (facial distance), below shown as dist, and my independent is age. I also have ID and each participant is measured at 4 time points (repeated measures). I would like to confirm with experts here whether my commands, under different conditions, are correct (My main interest is on command #3 fitting random slope only assuming fixed intercept- though not a common scenario):

    1. *Random intercept unconditional model
    mixed dist || ID:, var ml


    2. *Random intercept only
    mixed dist age || ID:, var ml


    3. *Random slope only
    mixed dist age ||age:, var ml

    4. *Both Random intercept & random slope
    mixed dist age || ID:age, var ml


    Your comments will be greatly appreciated.

    Owen

  • #2
    Your syntax looks correct, although it is definitely not a common scenario (to my knowledge) to fit a random slope without a random intercept.

    Another syntax you should be aware of is:

    Code:
    mixed dist age || ID: age, var ml covariance(diagonal)
    The covariance option specifies the covariance structure for the random effects. If you have ID and age, you have two random effects. By default, they are uncorrelated. With diagonal or unstructured (here they're equivalent, as you have one two random effects), you'd be saying that the random intercept and the slope are correlated. For example, perhaps those with higher baseline facial distance have greater growth rates (or smaller growth rates).
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment

    Working...
    X