dplyr's ntile() is not a quantile binning function, and that's a problem

The Trouble with 'Ntile()'

dplyr's ntile() is not a quantile binning function, and that's a problem

In a post from a data science blog, the author warns that dplyr::ntile() does not perform quantile binning as its name suggests. Using a simulated pharmacometric dataset with many tied weights at the median, she shows that ntile() assigns tied values arbitrarily to adjacent bins, making it unsuitable for statistical analysis. She advises against using it where accuracy matters.

It is emphatically not a tool for binning data into quantile-based groups, and it will absolutely misbehave when you use it for data analysis.

More from this day

2026-09-22