I'm trying to fit a GAMM model with this dataset, which can be downloaded here: https://ufile.io/8umh6 .
The dataset consists of 60 pixels sampled in two different areas: BAR and MON, 30 for each one. Each pixel has its (X,Y) coordinate in
NDVI values, which are between -1 and 1, through 1984-2017
QUADRIMESTRE (named incorrectly) variable refers to a three-month period, that is, 1 refers to January, February and March, 2 to April, May, June, etc.
I'm using the approach suggested in Zuur et al, 2009, chapter 18, this. So, the model is something like:
M3<-gamm(NDVI~ s(ANO,by=LOCAL,bs="cr")+s(QUADRIMESTRE, by = LOCAL,k=3) + s(X, Y), random=list(PIXEL=~1),data=samplesg2)
That is, I'm trying to extract a long-trend component through years (
LOCAL, the seasonality using
QUADRIMESTRE plus spatial component
(X,Y). The random intercept is because I would like to not keep the conclusions to only those 60 pixels, but similar pixels by place.
The idea is to extract the trends and compare with other variables' trends by local (BAR and MON), same idea proposed by Zuur (2009).
However, the residuals showed this pattern.
E <- resid(M3$lme, type = "normalized") F <- fitted(M3$lme) plot(x = F, y = E, xlab = "Fitted values", ylab = "Residuals", cex = 0.3)
In the book, one solution is to apply
weights=varIdent(form=~1|...)) but this keeps the pattern.
What can I do to remove this (possible) pattern presented by residuals? Does the fact that my response variable's values being between -1 and 1 part of the problem?
EDIT: Sorry, in the hurry, I forgot to include some graphs.
The first one is the box-plot of NDVI by LOCAL, for each one of the 60 pixels. Second is the box-plot of NDVI by season (3 months). So I can conclude that the NDVI values are different from MON and BAR. Also, the second box-plot showed some small(?) seasonality and different values by LOCAL.