I've worked through quite some documentation about both the nlme and lme4 package, (and quite some fora) but am still unsure whether I'm doing the right thing. Here's what I want to do: I want to build a linear mixed model (on daily diary data: 5x a day, 28 days, so 140 measurements for 110 persons in two treatment groups) as follows: Affect(dep.var) = Group + Time + Time^2 + group * time + group * time^2 + random.interceptsubjects + random.slopetime
My question is both theoretical and practical: 1. should I separately code random slopes for time^2, or is that nonsense, and if so, 2. is the following the correct way;
model <- lmer(affect ~ group + day + I(day^2) + group * day + group * I(day^2) +
(day||ID) + (I(day^2)||ID),
data = my_data, REML = TRUE)
note: I added the double || in an attempt to get the covariance structure 'unstructured', as an enlightened mind in our department said I should.
If it is correct, if I run it, it says that the model is nearly unidentifiable: very large eigenvalue. lme4 suggests rescale variable.
3. is it a serious issue in the first place, or can I more or less ignore it,
4. if I have to rescale, how does one go about? It has to do with the quadratic term, I know that, but any suggestions as to how I should then rescale are more than welcome...