RE: https://hachyderm.io/@djnavarro/117302635122528060 A small followup to this ...
Daniela Navarro @djnavarro@hachyderm.io
RE: https://hachyderm.io/@djnavarro/117302635122528060
A small followup to this post. The appendix contains links for the data and data-generating script, but perhaps more usefully, also links to a more carefully worked out version of the cut_quantile() function than the simple one I used in the post:
It allows user control over the quantile-estimation method used to define break points, and three options for tie-handling behaviour at the break points, including the two traditional quantile/cut approaches (ties always fall upwards and ties always fall downwards), along with a third “ntile-like” approach that allows tie-splitting to produce more even bins, but only permits ties to be broken randomly (with built-in seed control), never by row order. It automatically detects when the data set cannot support the number of requested bins, and provides informative warnings and error messages as needed.