The trouble with ‘ntile()’
Summary
The blog post warns against using dplyr::ntile() for quantitative binning, arguing that ntile() breaks ties by row order and does not produce true quantile-based groups. It demonstrates the problems with tied weights in a pharmacometric-style dataset, shows how ntile can create misleading quartiles, and offers alternatives that compute quantile-based splits using quantile() and cut(), including explicit handling of edge cases and tie-breaking. The piece also discusses regulatory implications and conventions around bin definitions.