Panel data: subjects' value
are repeatedly measured over time
points. Suppose the first half was the pretest (grp=0
) and the second half received the intervention (grp=1
).
Take this post as an example:
ID | time | grp | value |
s_1| 1 | 0 | Q_11 |
s_1| 2 | 0 | Q_12 |
s_1| 3 | 0 | Q_13 |
s_1| 4 | 1 | Q_14 |
s_1| 5 | 1 | Q_15 |
s_1| 6 | 1 | Q_16 |
Now, run a linear mixed-effecs regression value ~ time * factor(grp) + (time | ID)
. Each subject ID
will have its own intercept and slope over time.
However, my concern is that grp
can be derived from time
, i.e., grp = ifelse(time <=3, 0, 1)
. This may be collinearity (I wonder if that's the exact word to use because one variable is categorical).
How do I fix the issue or even conduct another model? Thanks.