r2.glmmTMB "Warning: get_variance ignores effects of dispersoin model."
Hello,
I'm using the package performance (love it), and came across an issue. It seems the r2() function can't deal with glmmTMB models that include a dispersion model (dispformula). Would there be a "quick" way to make this possible?
repro:
library(glmmTMB)
library(performance)
data(mtcars)
mod <- glmmTMB(mpg ~ cyl, dispformula = ~ cyl, data = mtcars)
performance::r2(mod)
This gives the message "Warning: get_variance ignores effects of dispersion model. Random effect variances not available. Returned R2 does not account for random effects." (The random effect part is ok; I didn't put one, but the part is the issue and it happens also whene there is a random effect).
Thank you in advance for your input! Mick
The problem is that that there isn't one R2 for a model with a dispersion model. There's one for every possible value of sigma.
We should perhaps consider treating these models more like generalized models like binomial or Poisson models