I am trying to build a random intercept/random slope model with longitudinal data (time is nested within individual). The outcome is continuous, so I use mixed command. The problem is that there are only two time points (pre and post). If I had more time points, like 4 time points (e.g., week 1-4), slope makes sense to me, but I am not sure if random “slope” makes sense in my case since time variable is binary (1/0).
Let’s say that Y is the outcome, X is the treatment (control (0) vs. treatment (1)), and T is the time variable (1 for post and 0 for pre). Here is my syntax.
Code:
mixed Y i.T##X || id: T, var cov(un)
Code:
mixed Y i.T##X || id: T, var cov(un) noconstant
Second, I am curious if the random slope model can be used when I have a binary time variable.
Please advise!
Thank you.
0 Response to mixed with 2 time points
Post a Comment