DigiNews

Tech Watch by Johan Denoyer

← Back to articles

The trouble with ‘ntile()’

Quality: 8/10 Relevance: 8/10

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.

🚀 Service construit par Johan Denoyer