[R-sig-ME] Calculating R2 for a GLMM with small response values/Tweedie family
Skye Bruce
@kye@bruce @end|ng |rom w|@c@edu
Sat Apr 15 21:13:47 CEST 2023
Greetings,
I am emailing to ask about calculating R2 for a GLMM using Tweedie family of distributions in the glmmTMB + performance packages in R. My response variable contains many zeroes and very small values, and performance is having trouble calculating my model's distribution-specific variance, making the resulting R2 unreliable. Is there a more reliable way to calculate R2 for this GLMM?
I have measured my response variable, monarch butterfly eggs and larvae per m2, on grazed lands that vary in (predictors) grazing management category, floral richness, milkweed density (stems/m2) over two years, with three visits per year to each site.
Data .csv file attached.
Input:
mod1.egglarv1m.twe <- glmmTMB(egglarva1m ~ category + florarich + submilk1m + visit + year + category:year + (1|site),
data = egglarv1m.scale,
family = tweedie)
performance::r2(mod1.egglarv1m.twe)
Output:
# R2 for Mixed Models
Conditional R2: 1.000
Marginal R2: 0.724
Warning messages:
1: mu of 0.0 is too close to zero, estimate of random effect variances may be unreliable.
2: Can't calculate model's distribution-specific variance. Results are not reliable.
Thank you for your assistance,
Skye Bruce
PhD Student
University of Wisconsin–Madison | Entomology
More information about the R-sig-mixed-models
mailing list