ronkeizer / vpc

R library to create visual predictive checks (VPC)
Other
36 stars 20 forks source link

Last bin for observed data #55

Closed friedax7 closed 4 years ago

friedax7 commented 5 years ago

Hi and thanks for this very nice package.

I was wondering about the behaviour of the lines for the observed data after the last bin which come together at a point for all vpcs I have done with this package.

_vpc_all_final_Tox_2cmt

I've seen it is because the db$aggr_obs dataset in the plot_vpc code contains a bin with minimum and maximum values and bin number set to NA and the bin mid equal to the upper limit of the last "regular" bin. It contains one observation that is above the upper limit of the last bin. Is this intended? Is there a way to turn this off?

Best Regards,

Anna Friedel

ronkeizer commented 5 years ago

hi Anna, is there any way you can share a reproducible example that shows this behavior? It does indeed sound like something is not working well with binning here, but it's hard to see from the description if this is a bug or a "feature" :)

friedax7 commented 5 years ago

Hi Ron,

thanks much for the quick reply. Here's attached some code based on the simple_data included in the package that should explain what happens. Seems like the missing include_lowest=TRUE in the bin_data function causes this.

test_vpc_package.txt

Best Regards,

Anna

ronkeizer commented 5 years ago

Thanks for the reproducible example, I just pushed a fix to the master branch. If you re-install from GitHub, the issue should be gone.