I am trying to use R function performance::r2()
to calculate marginal and conditional R2 of a fitted model of class glmmTMB
. To ask this question, I am making use of existing code provided in the document ‘Getting started with the glmmTMB package’ (Bolker 2024), available at link, and the Owls
dataset included in package glmmTMB
. All code below is taken from that document verbatim, except the use of function performance::r2()
in the last line. My question refers to the warning message (shown below) thrown by function performance::r2()
when passed the fitted model of class glmmTMB
.
library(glmmTMB)
library(performance)
Owls <- transform(Owls,
Nest=reorder(Nest,NegPerChick),
NCalls=SiblingNegotiation,
FT=FoodTreatment)
fit_zipoisson <- glmmTMB(NCalls~(FT+ArrivalTime)*SexParent+
offset(log(BroodSize))+(1|Nest),
data=Owls,
ziformula=~1,
family=poisson)
performance::r2(fit_zipoisson)
Running lines above yields the following output (copied directly from console):
> performance::r2(fit_zipoisson)
# R2 for Mixed Models
Conditional R2: 0.086
Marginal R2: 0.019
Warning message:
mu of 2.1 is too close to zero, estimate of random effect variances may be unreliable.
I am trying to determine if this warning message is a simple incompatibility between
packages glmmTMB
and performance
which does not indicate any real issue with model fit, or if it indicates a real or potential issue with model fit. I have seen this warning consistently when fitting a simpler zero-inflated mixed effects model to another dataset. I am using the owls dataset from package glmmTMB
for troubleshooting only.