0

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?

enter image description here

enter image description here

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

Lili
  • 547
  • 6
  • 19
  • Removing levels of a factor is just wrong, also you need to add some explanation to your plots, what are they and what are we supposed to see? – user2974951 Sep 26 '18 at 12:18
  • Thanks for your comment. I am so sorry I am a beginner in stats and R . The variable 'Status' has 4 different groups of patients (H, A, F, N). Just to clarify, when I say "remove levels of a factor" I mean that I've created a new dataset where Status only has A and H patients for example. The plots express the model pasted below them. I am editing the post to show you my code. Are those "multiple comparisons" wrong? If so, how can I do multiple comparisons in longitudinal data? And if they are right, how can I interpret this? Thanks! – Lili Sep 26 '18 at 12:26

0 Answers0