Differences in DHARMa::plotQQunif and check_residuals() for glms
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
- Domain
- data-visualization
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
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
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from easystats/performance
-
Consistency :green_apple: :apple: Docs :books:
Difficulty 1/5 Under an hour Newbie friendliness 72/100
easystats/performance#987 ·
Maintainers usually reply within 1 day
-
Consistency :green_apple: :apple:
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
easystats/performance#986 ·
Maintainers usually reply within 1 day
-
`check_outliers()`: Cook's distances land on the wrong rows when the model skips or reorders rowsOpen3 investigators :grey_question::question: Bug :bug:
Difficulty 4/5 3-5 days Newbie friendliness 22/100
easystats/performance#981 ·
Maintainers usually reply within 1 day
-
Docs :books: Enhancement :boom:
Difficulty 5/5 Over a week Newbie friendliness 45/100
easystats/performance#901 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Enhancement :boom:
Difficulty 4/5 3-5 days Newbie friendliness 35/100
easystats/performance#891 ·
Maintainers usually reply within 1 day
All issues in easystats/performance
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AlexsLemonade/scpca-nf#1357 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
REditorSupport/vscode-R#1883 ·
Maintainers usually reply within 1 day
-
Error out post processing step if there are multiple folders in /exec with the same index numberOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100