Stata Xtile. For 100 million observations this took 31 minutes. These give the third quartile as r quantile auto price 0 75 type 2.
In many other applications i can use by to save on a loop e g. Sort date by date. Description pctile creates a new variable containing the percentiles of exp where the expression exp is typically just another variable.
Xtile newvar ret nq 5 however stata doesn t let me combine xtile with by.
This list is comprehensive as of october 29 2019. The last three commands have an altdef option that gives the same answer as centile. Sort date by date. 1 2 3 5 7.