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

Original title: The Trouble with 'Ntile()'

> Hacker News story 49782702 · language: en · submitted 2026-09-21
> Web version: https://zeli.app/story/49782702
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 23 · by [luu](<https://news.ycombinator.com/user?id=luu>) · 💬 3
[original](<https://blog.djnavarro.net/posts/2026-09-20_the-trouble-with-ntile/>) · [HN discussion](<https://news.ycombinator.com/item?id=49782702>)

## Summary

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.

## Key quote

> 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.

---

## Cite

- Page: https://zeli.app/story/49782702
- Date: 2026-09-21
- Source: blog.djnavarro.net (https://blog.djnavarro.net/posts/2026-09-20_the-trouble-with-ntile/)
- Hacker News: https://news.ycombinator.com/item?id=49782702

## Other languages

- zh: https://zeli.app/zh/story/49782702 · markdown: https://zeli.app/zh/story/49782702.md
- ja: https://zeli.app/ja/story/49782702 · markdown: https://zeli.app/ja/story/49782702.md
- ko: https://zeli.app/ko/story/49782702 · markdown: https://zeli.app/ko/story/49782702.md
- de: https://zeli.app/de/story/49782702 · markdown: https://zeli.app/de/story/49782702.md
- es: https://zeli.app/es/story/49782702 · markdown: https://zeli.app/es/story/49782702.md
- ru: https://zeli.app/ru/story/49782702 · markdown: https://zeli.app/ru/story/49782702.md
