Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Differences in DHARMa::plotQQunif and check_residuals() for glms

Open
#807 10 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
Needs clarification
Activity status
Stale
Tech stack
r

Research direction

Start by running the issue's reprex and comparing DHARMa::plotQQunif() with performance::check_residuals() on the same simulated residuals. Trace how each function produces its plot and verify whether their underlying values and KS tests agree. Done means explaining the upper-tail difference and identifying whether it is expected behavior or a performance bug.

Written by the indexing model from the issue text.

Description

Waiting for response :love_letter:

So, I've noticed when plotting simulated quantile residuals, the results can be quite different between using DHARMa and performance.

For example, in this code:

library(DHARMa)
library(lme4)
library(performance)

library(DHARMa)
library(lme4)
library(performance)

set.seed(31415)
testData = createData(sampleSize = 10, overdispersion = 0.5, family = poisson())
fittedModel <- glm(observedResponse ~ Environment1,
                     family = "poisson", data = testData)

simulationOutput <- simulateResiduals(fittedModel = fittedModel)

plotQQunif(simulationOutput,
           testDispersion = FALSE,
           testUniformity = FALSE,
           testOutliers = FALSE)

check_residuals(simulationOutput) |> plot()

This produces

Image

Image

While qualitatively these match, there are some big differences at the upper tail with the performance version looking really problematic while the DHARMa version does not.

What's going on here? This seems like there shouldn't be disagreement, and it makes me nervous that there is!

This is a reprex, but in working with real data, the discrepencies are even larger - although the KS tests agree. So, the values are the same? I'm confused.

Dominant language
R
Stars
1.2k
Forks
108
Avg merge
22h 29m
Merged PRs (30d)
33

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.