Possible error in r2_xu in performance

Open
#598 0 comments 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 at the r2_xu calculation quoted in the issue and read the surrounding performance implementation. Compare it with equations (5) and (6) of Xu (2003); done means the applicable definition is established and the implementation and regression coverage reflect it.

Written by the indexing model from the issue text.

Description

3 investigators :grey_question::question: Bug :bug:

Hello,

I just wanted to briefly point out that, in my opinion, r2_xu in performance might not be correctly specified; to me it looks like the function calculates an omega as given in equation (6) of Xu (2003; 0.1002/sim.1572), altough this equation seems to be only for null models. In the current version r2_xu is calculated as follows:

r2_xu <- 1 - stats::var(stats::residuals(model, verbose = FALSE))/stats::var(insight::get_response(model, verbose = FALSE))

This means that the variance of the residuals of the model with covariates is devided by the variance of the reponse (equation 6), not by the residual variance of the null model (as in equation 5).

Of course I might also get it wrong?

Best wishes

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.