How to write LME model in R? I'm new to LME and i'm trying to make a longitudinal LME analysis in R of changes to the volume of the hippocampus in elderly people.
The data consist of ~300 subjects which have been randomly assigned to 3 different treatments. Each subject have been measured 3 times over a period of 3 years.
The data format is in colums where both the time_point and group number go from 1-3. The subject number goes from 1-100 and then repeats for time_point 2. When the group number changes the subject number starts at 101-201 for time_point=1, group=2 and similarly 101-201, time_point=2, group=2.
I'm having troubles with setting up the correct model based on the data. I have done the following, but am unsure whenther the model is correctly written according to my data structure, since there is no significant effect of the treatment?
Data$TP <- factor(Data$Time_Point)
Data$Group <- factor(Data$Group)
Data$Subjectnum <- factor(Data$Subjectnum)


require(lmerTest)
model1 <- lmer(left_Whole_hippocampus ~   Group * TP + (1|Subjectnum), data = Data)
anova(model1)
ranova(model1)

> anova(model1)
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Group      2807  1403.4     2   303  1.0073    0.3664    
TP        58518 29259.1     2   606 21.0011 1.519e-09 ***
Group:TP   3576   894.1     4   606  0.6417    0.6329    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> ranova(model1)
ANOVA-like table for random-effects: Single term deletions

Model:
left_Whole_hippocampus ~ Group + TP + (1 | Subjectnum) + Group:TP
             npar  logLik   AIC  LRT Df Pr(>Chisq)    
<none>             11 -5446.4 10915                       
(1 | Subjectnum)   10 -6641.4 13303 2390  1  < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

 A: Based on the further clarifications you made in the comments, I would suggest one additional model to consider in your analysis. Specifically, it is worth considering whether the rate of change in the left_Whole_hippocampus varies across persons. That is, do you expect that all subjects experience the same rate of deterioration in their hippocampus or is it possible that some experience more degradation than others? If this is the case, then you want to run the following model:
model2 <- lmer(left_Whole_hippocampus ~   Group * TP + (1+TP|Subjectnum), data = Data)

This model has a random/varying slope for TP. Said differently, the varying slope allows the association between TP and left_Whole_hippocampus to differ by subjects. To the extent that the association does differ, then your interaction term further probes whether the differential rate of degradation/change is dependent on which Group a subject was in.
Using a package such as ggeffects, you can easily plot this interaction effect:
library(ggeffects)
ggpredict(model2, c("Group", "TP")) %>% plot()

You can also use a likelihood ratio test to compare the two models to see whether model2 provides a better fit to the data than model1, which would be reflected in a p-value<.05:
anova(model1, model2)

