r2.glmmTMB "Warning: get_variance ignores effects of dispersoin model."

Open
#435 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

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.

Description

3 investigators :grey_question::question:

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

Dominant language
R
Stars
1.2k
Forks
113
Avg merge
9h 8m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from easystats/performance

All issues in easystats/performance

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.