easystats / easystats/performance
`r2_nakagawa` compatibility with `HLCor` object
Nobody has claimed this yet.
- 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 classHLCorare not supported.
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 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