Could I please get some advice on coding a linear mixed model for looking at between and within group effect. I have 2 Timepoints (Baseline and 12 weeks Post intervention) and 2 groups (Ex1 and Ex2).
Outcome variable ~ Group*Timepoint + (1|ID)
I know this will answer the first and second points but I want to run one model so I can answer all three
I want to see if there is an interaction between timepoint and group. (i.e after the intervention did the outcome variable improve more in Ex2 than Ex1).
I want to see if regardless of group did my outcome variable change after 12 weeks
And finally (this is part I am struggling with), within each group did my outcome variable change from Baseline to 12 weeks post?
Outcome variable ~ Group*Timepoint + (1+Timepoint|Group)
OR
Outcome variable ~ Group*Timepoint + (1+Timepoint|Group/ID)
Group
, or with eachID
? From the wording of point 3 it seems you mean within eachGroup
but the title of the question says it's within "subject" - that is, withinID
. Please clarify. $\endgroup$