Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #419 +/- ##
==========================================
+ Coverage 98.66% 98.70% +0.04%
==========================================
Files 35 35
Lines 5857 5889 +32
==========================================
+ Hits 5779 5813 +34
+ Misses 78 76 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Fantastic, thank you! I will doubtlessly have a use case for this in the next two weeks, and I will report if there's any issues. |
|
@behramulukir, sorry for the basic question, but how do I get to the function? I don't see it when I install the latest development version of bayesplot. |
|
Did you install the correct branch @mhollanders? As the changes are not merged to the master branch yet, you should install the branch I am working on. You can do it with |
|
Thank you, and pardon for my ignorance. It works great! |
|
No worries! I'm glad that you liked it |
|
Thanks @behramulukir and thanks @mhollanders for testing it out!
Does |
Among the existing PPC count plots, I think You can also check Visualizing Count Data Regressions Using Rootograms paper by Christian Kleiber and Achim Zeileis. The paper contains an example case where "a well-known data set from ethology, for which excess zeros and, more generally, overdispersion require treatment". If you find a solution that you think is worth implementing in bayesplot, please let me know! I would be interested in implementing it (unless you don't want to do it yourself, of course) |
|
I would highly recommend using Teemu's discrete rootogram. Using square scaling on both x and y axis improves readability in case of high proportions and counts, and discrete nature of the data and model is more emphasized. Also for zero-inflation part you should use binary target calibration plots as illustrated, for example, in Nabiximols case study |
|
Thanks! The rootograms in bayesplot are those rootograms, right? |
|
Yes, |
|
@behramulukir I had a chance to come back to this and I have two different ideas for handling the
Then inside the plotting function do something like this: and then use Then later:
One issue with this approach is we can't control the style of the interior axes, they just follow the general theme:
|
|
Thank you so much, @jgabry! I was also thinking about this and wasn't able to come up with anything new. It's great that you had fresh ideas. I think your first idea is similar to what I proposed in the previous message, which didn't fully convince me.
I personally prefer to have a gap between the dots and the x-axis line, and I felt like removing it led to worse results aesthetically and felt rather cluttered. It also broke the consistency of the graphs by having an unignorable visual difference between the grouped and non-grouped versions of the same plot. However, I quite liked the second idea. I wasn't aware of the possibility of drawing interior axes natively, and I liked it. I think it looks nice in the image you shared. Compared to the interior axes of other grouped plots, it seems like the only difference is the existence of tick marks in the axis lines. I think that's a smaller difference than the gap between dots and the x-axis line, and the one which I would prefer. What's your opinion, though? Do you have a preference between the two options? |










This PR adds
ppc_rootogram_groupedfunction requested at #377. If you have any feedback, I am happy to hear @mhollanders.ppc_rootogram_groupedsimply creates multiple facets (plots) of the rootogram based on the grouping user passes to the function as an argument.Something to note here is that in
ppc_bars_grouped,force_axes_in_facetsfunction is used to make sure all facets have axes. This was resulting in errors when used withppc_rootogram_grouped(style="discrete")since-Infresults inNaNwhen used withscale_y_sqrt(). It was still used in other rootogram styles, but so far, I hadn't managed to get it working for discrete style. I'll mark this PR as ready once I find a solution to that.Tasks:
discretestyleExamples