We are using a mixed-effects model to assess the potential impact of different treatments (categorical variables) on a specific soil characteristic (numerical variable). The study uses a randomized complete block design with plots nested in blocks.
Longitudinal data were collected and initial assessments of the raw data indicated temporal autocorrelation. There were 12 total samples taken during each observation, with three treatments represented within four blocks. For example, data collected on date 1 were similar in format to:
The treatments were considered the fixed effects and time and block (both factors) were considered random effects.
The basic model being used is:
M1<-lmer(y~Trt1+(1|Block)+(1|Date),data)
I have reviewed the results of model and reviewed the residual plots. To look at the residuals, I used the compute_resid function to calculate marginal and conditional residuals and applied the acf function. However, since we have multiple observations per date, I am not sure the best way to handle the residuals.
I also tried using lme with a similar approach but specifying the correlation. However, it did not appear to improve the outcome.
My primary questions are:
1.Should time (monthly data in this case) be considered a fixed or random effect?
2.How should I assess the residuals (as well as model performance in general)? When I average the residuals by time (I'm not sure this is the best approach), strong autocorrelation is indicated when time is included as a random effect but the autocorrelation is not present in the residuals when time is included as a fixed effect.
3.What is the best type of residual to use in this case (e.g., conditional vs. marginal)?