0

I'm trying to build a linear mixed model in R using nlme. My response variable is distributed like that: enter image description here

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 : enter image description here

The issue seems to come from the n_boat variable : enter image description here

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)

enter image description here

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!

  • A mass can't be negative. Why do you have negative masses in your data? I don't think heteroscedasticity is your main issue. – Roland May 10 '23 at 09:07
  • It is mass variation, some values are negative, and it's normal, but it's a small part of the dataset – Benjamin Dupuis May 10 '23 at 09:23
  • Looking at the plots, they seem to indicate some "soft" lower and upper limits to the DV. It looks like it can't be much below zero or above 600. – Roland May 10 '23 at 09:28

0 Answers0