Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revising check_model() #698

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Revising check_model() #698

wants to merge 25 commits into from

Conversation

@strengejacke
Copy link
Member Author

@bwiernik and @mccarthy-m-g - I think the implementation works quite well now for the first methods. The plot() method works fine for the Q-Q plots (easystats/see#329). Things we should consider:

  • We would have to update the plot for overdispersion/zero-inflation checks (see DHARMa implementation for new check_residuals() function #643 (comment)). This is still based on the classical residuals, not the simulated ones. I have played around with revising the current code, copying the function .diag_overdispersion into a new .new_diag_overdispersion (see

    .new_diag_overdispersion <- function(model, ...) {
    ). This did not really work - do you have any ideas how we can have new plots for overdispersion/zero-inflation? I found these plots quite informative and would like to keep them, beside the Q-Q plot. See also discussion here.

  • check_zeroinflation() and check_overdispersion() now rely on simulate_residuals() for zero-inflated or negative binomial models etc., so only the really "simple" models that returned identical results to DHARMa-tests still use the old code. Only Poisson mixed models also use the "old" code, which still could be inaccurate (see check_overdispersion underestimates dispersion in mixed models #464) - do we want to use simulate_residuals() in general for mixed models when calling check_zeroinflation() and check_overdispersion()?

  • How do we want to deal with y axis limits when detrend = TRUE in Q-Q plots? (see DHARMa implementation for new check_residuals() function #643 (comment))

  • A method for check_autocorrelation() is not yet implemented. Since the DHARMa tests require additional information, I'm not sure about how to best implement such methods.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 57.73%. Comparing base (6e1eb60) to head (2be53b8).
Report is 3 commits behind head on main.

Files Patch % Lines
R/check_model_diagnostics.R 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #698      +/-   ##
==========================================
+ Coverage   57.69%   57.73%   +0.03%     
==========================================
  Files          87       87              
  Lines        6444     6464      +20     
==========================================
+ Hits         3718     3732      +14     
- Misses       2726     2732       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revising check_model()
3 participants