I'm trying to build a linear mixed model in R using nlme. My response variable is distributed like that:
My final model presents a lot of heteroscedasticity and I cannot find a solution to correct it. The model is something like :
lme(mass ~ n_boat + n_spec + breeding_stage*season,
random = list(ID = ~1),
data = my_data)
and the variance of residuals looks like that :
The issue seems to come from the n_boat variable :
I tried using different variance structure to correct that effect, but none seems to work properly. Here is and example with varFixed
var_fix <- varFixed(~n_boat)
lme(mass ~ n_boat + n_spec + breeding_stage*season,
random = list(ID = ~1),
data = my_data,
weights = var_fix)
I also tried log transforming my response variable with no results.
How should I address this issue ? Shall I do something with the data before the model ? I'm a bit lost at this point.
Thanks for your help!