traitecoevo / fg_spectral_diversity

0 stars 0 forks source link

looking at model errors #31

Open adelegem opened 2 weeks ago

wcornwell commented 2 weeks ago

looks like this is not a model problem. the model thinks that there is very little across site variance in that particular response variable:

Screenshot 2024-08-30 at 3 04 07 PM

10^-6 is very very small, so it's effectively not a mixed model at that point and residual r2 kinda loses it's meaning. In other words, not a major problem

Carry on.

wcornwell commented 2 weeks ago

i asked chatgpt the same question and they agree, but maybe explain it more clearly:

Insufficient Variation Across Groups: The random effect in your model ((1 | site)) is supposed to account for variability between different sites. If the variation in your outcome variable (shannon_diversity) across sites is minimal, the model can't estimate a meaningful variance for the random effect. This leads to a very small or zero variance component, triggering the singularity warning.

I feel chatGPT is the best when it agrees with me.

I'm also a bit befuddled by the use of the word "singularity" for multiple things in statistics. I guess it means that something internally is 0 and it's in a denominator somewhere so something else is infinity, but multiple different things can be 0 and/or infinity, which is confusing for non-robots.

wcornwell commented 2 weeks ago

chatGPT also suggested dropping the random effect for these cases:

model_simple <- glmmTMB(shannon_diversity ~ scale(CV), data = df_filtered)

which reminded me I did exactly that for this very reason in previous papers. this seems like a way forward although it will probably mess up your pretty four for loop code. Alternatively, we just leave it like it is and explain about the NA values for residual r2 in the caption of that table.