# Mixed-model alternative for the time course: correlation falls with the time between readings
# (continuous-time AR(1), suitable for unevenly spaced readings). nlme 3.1-164, R 4.3.3.
suppressPackageStartupMessages(library(nlme))
d <- read.csv("gtt.csv")
d$group <- factor(d$group, levels = c("chow", "HFD"))
m <- gls(glucose ~ group * factor(time), data = d, correlation = corCAR1(form = ~ time | mouse))
anova(m)
