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

Quantile regression curves not displaying in DHARMa residual plots #466

Open
LuisiCo06 opened this issue Feb 26, 2025 · 4 comments
Open

Comments

@LuisiCo06
Copy link

When I generate the residual plots using the DHARMa package, the quantile regression curves do not appear in the residual vs. predicted plot (right plot). Instead, I receive warnings stating that the quantile regressions failed for the 0.25, 0.5, and 0.75 quantiles.

Image

The warning messages are:

DHARMa: qgam was unable to calculate quantile regression for quantile 0.25. Possibly too few (unique) data points / predictions. The quantile will be omitted in plots and significance calculations.

DHARMa: qgam was unable to calculate quantile regression for quantile 0.5. Possibly too few (unique) data points / predictions. The quantile will be omitted in plots and significance calculations.

DHARMa: qgam was unable to calculate quantile regression for quantile 0.75. Possibly too few (unique) data points / predictions. The quantile will be omitted in plots and significance calculations.

I’ve tried:
-Verifying the characteristics of my dataset several times.
-Running the exact same code on another device, where the quantile curves displayed correctly without issues.

Could you please help me identify why the quantile regressions are failing on this device? Is there a potential system-specific issue or configuration that might explain the difference between devices?
If recquired, here is some of the environment Information:
-R version: 4.4.1 (Race for Your Life) – released on June 14, 2024
-RStudio version: 2024.09.0+375 (Cranberry Hibiscus), desktop mode
-DHARMa version: 0.4.7

Thank you in advance for your assistance! 🙏

@melina-leite
Copy link
Collaborator

Hi @LuisiCo06,
This is indeed unexpected and shouldn't, in principle, happen. I don't know if the issue is with DHARMa or qgam.

Could you email or post here a (not)working example so we can better investigate the issue?

Best,
Melina

@florianhartig
Copy link
Owner

To clarify - this error message occurs if the qgam package throws and error, which usually only occurs with very few data points. Maybe you could re-install qgam and see if that helps.

In any case, I second Melina's point to provide us with a reproducible example!

Best
F

@LuisiCo06
Copy link
Author

Thank you both, Melina and Florian, for your attention and suggestions. I appreciate your willingness to help troubleshoot the issue. I managed to resolve the problem by reverting to an earlier version of the DHARMa package, specifically version 0.4.6. Thank you once again for your support!

Best,
Luis

@melina-leite
Copy link
Collaborator

Hi @LuisiCo06,
I'm glad you could solve your problem!
It would be important for us to understand what caused the issue to prevent it from happening again with other users, especially if it may be related to the newest DHARMa version.
I understand if you don't want to share a working example by email, but could you send us the version of the qgam package that worked and the one that didn't?

Best,
Melina :)

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

No branches or pull requests

3 participants