I have a variable with 4 factors that I put into the LME model as an independent variable (Status). The outcome in lme gives me 1 factor as a reference value and the other 3 referenced to that one. I have tried to apply 'emmeans' to get multiple comparisons as I am interested on knowing how each factor was behaving against each other, but it was not possible (perhaps because this data is longitudinal?). So I have created subsets in which each "status" variable only have 2 factors. The problem comes when I try to interpret the outcomes, as it seems that for example the factor A sometimes gets better and sometimes gets worse. (see pictures) Can anyone help me?
This is the code I've used to create the graphs:
x <- c(0:600)/100
Hdata <- data.frame(Time = x, Status = "H", Init.Age = 43)
Ndata <- data.frame(Time = x, Status = "N", Init.Age = 45)
Fdata <- data.frame(Time = x, Status = "F", Init.Age = 40)
Adata <- data.frame(Time = x, Status = "A", Init.Age = 45)
yH <- predict(mod2.lme, newdata = Hdata, level = 0)
yN <- predict(mod2.lme, newdata = Ndata, level = 0)
yF <- predict(mod2.lme, newdata = Fdata, level = 0)
yA <- predict(mod2.lme, newdata = Adata, level = 0)
summary(long1$Ratio_a)
plot(x, yH, ylim = c(0.3, 0.6), ylab = "Average Pit Depth/Slope Disk Area", xlab = "Time (years)", type = "l")
lines(x, yF, col = "blue")
lines(x, yA, col = "red")
lines(x, yN, col = "green")
legend("bottomleft", legend = c("H", "A", "F", "N"), col = c("black", "red", "blue", "green"), lty =1, cex = 0.8, bty ="n")
Thanks a lot! Lili