easystats / easystats/performance
r2.glmmTMB "Warning: get_variance ignores effects of dispersoin model."
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 8
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducible glmmTMB example using mtcars and run performance::r2(mod). Trace the r2() and get_variance() paths for models with dispformula; done means dispersion-model effects are accounted for without the reported warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100