easystats / easystats/performance

`r2_nakagawa` compatibility with `HLCor` object

Open
#246 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement :boom:
Dominant language
R
Stars
1.2k
Forks
109
Avg merge
6h 34m
Merged PRs (30d)
8

Description

Hello! Love your packages, but wondering if there is a way to make the r2_nakagawa function compatible with an HLCor object from the spaMM package? Seems like the get_variance function within "Insight" doesn't work with the structure returned by spaMM. Example code (taken from spaMM vignette) here:

data(scotlip)
lipfit <- fitme(cases~I(prop.ag/10)+adjacency(1|gridcode)
                +offset(log(expec)),
                data=scotlip,family=poisson(),adjMatrix=Nmatrix)
summary(lipfit)
r2_nakagawa(lipfit)

Warning message:
In get_variance.default(model, tolerance = tolerance, name_fun = "r2()", :
Objects of class HLCor are not supported.

Contributor guide

Open the contributing guide

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.

Research direction

Start with r2_nakagawa and the get_variance path shown in the report, then reproduce the spaMM vignette example using the HLCor object. Trace how the HLCor structure reaches the unsupported-object warning; done means the example no longer emits that warning and returns the requested R² result.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.