Announcement

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

  • Question about linear mixed effects modeling: random intercepts model versus random slopes model

    Suppose we have a longitudinal dataset with variables ID, y (outcome), x (primary predictor), time and some covariates. Each ID was measured at 4 time points. I want to use the "mixed" command to generate linear mixed effects models.

    For random intercepts model, my command is:
    mixed y covariates i.time || ID:
    est store ri


    For random slopes model, my command is:
    mixed y x covariates i.time || ID:
    est store rs


    For mixed effects model, my command is:
    mixed y x covariates i.time || ID: x, cov(unstructured)
    est store me


    Questions:
    1. For the mixed effects model, how do I determine which covariance structure to use?
    2. If I get p > 0.05 from lrtest me rs, does this mean random slopes model is preferred over mixed effects model?

    Please let me know if there is anything that needs clarification or correction. I'll make sure to reply as soon as possible. Thank you for your help and insight!
    Last edited by Joon Park; 28 Oct 2022, 14:14.

  • #2
    Why do I get p-value of 1.0000 when I run lrtest rs ri command?
    While I do not want to firmly commit to an explanation when you have not shown the actual outputs of the models, the usual interpretation here would be that in fact there is effectively no ID-level variation in the y:x slope. You could also confirm that explanation by seeing what the variance estimate for the random x-slopes is: it should be very, very close to zero.

    That said, there are exceptional circumstances where one or both of the models has not actually converged, or there are other problems. One would need to see the full model output to exclude these cases.

    What is the command phrase to run a linear mixed effects model that accounts for both random intercepts and random slopes?
    That is precisely what your random slopes model command does. It accounts for both random intercepts and random slopes.

    Comment


    • #3
      Thank you Dr. Schechter,

      I just wanted to say thank you for your posts in this forum. I found out about the forum recently and found them extremely helpful, especially your answers to many of the questions.

      Comment

      Working...
      X