I'm new to longitudinal analyses, and I'm having trouble formulating a model that accurately reflects my study design. This study recruited subjects for two groups (dx vs. control), with measurements taken for each subject at three different timepoints. Age at baseline varied from subject to subject; from what I've read, this means the design is "unbalanced."
My data frame is organized such that if row n reads:
[subject_ID = x, baseline_age = y, Group = 1, Timepoint = 1, DV = k]
then row n+1 reads:
[subject_ID = x, baseline_age = y, Group = 1, Timepoint = 2, DV = m]
I'm interested in relationships between baseline_age
, timepoint
, and Group
. If baseline_age
weren't a factor, I think the R code would be as follows:
mod1 <- lmer(DV ~ timepoint + Group + timepoint:Group + (timepoint|subject_ID),
data = mydat)
where (timepoint | subject_ID)
reflects the fact that timepoint
varies at the individual level. However, assuming the above is correct, my confusion arises when I try to model random effects with baseline_age
entered into the equation. Since baseline_age
and subject_ID
are perfectly correlated, would it be possible to use baseline_age
as proxy for subject_ID
in lmer
? Or should I model a second random effect? Specifically, I'm considering the following three-way interaction model:
mod2 <- lmer(DV ~ timepoint + Group + baseline_age + timepoint:Group +
timepoint:baseline_age + Group:baseline_age +
timepoint:Group:baseline_age + (timepoint | baseline_age),
data = my dat)
baseline_age
andsubject_ID
perfectly correlated ? You said that Age at baseline varied from subject to subject.... $\endgroup$subject_ID
, so it can't be collinear withtimepoint
. Please can you explain your data a little more ? If you could explain the data a little more it would help to formulate an answer. $\endgroup$