Percentile, using Stata's algorithm (Hyndman & Fan "Type 2")
Source:R/utils-panel.R
percentile_stata.RdStata's summarize, detail / _pctile / xtile all use a percentile
algorithm confirmed equivalent to R's quantile(type = 2) (Hyndman & Fan
1996) — not R's default type = 7. Used here instead of bare
stats::quantile() wherever the source computes r(p1)/r(p99) for
winsorizing or trimming.