Sample quantiles
A sample quantile is a value located in ordered observations according to a specified quantile convention.
On this page 7 sections
01A sample quantile locates a position in ordered observations#
A sample quantile locates a position in ordered observations. The answer depends on the convention. This lesson uses nearest rank: for , sort, multiply by the count , and round upward to a whole position.
For and , the rank is . Read the third value, .
Rule: sort; take rank pn rounded up. Sample: 7, 2, 10, 5, 12. p=0.7. Quantile?
Show answer and explanation
Rank 4; sorted value 10.
02Round upward even when the decimal part is small: 2.1 gives rank 3#
Round upward even when the decimal part is small: gives rank . An exact rank such as stays . At , this rule selects the largest observation.
Counts include repeats. If occurs twice and three times, the ordered list is . With , rank gives value .
Rule: sort; take rank pn rounded up. Counts: 3 occurs 3 times; 8 occurs 2 times. p=0.8. Quantile?
Show answer and explanation
5 observations; rank 4 gives 8.
03Different conventions can give different answers#
Different conventions can give different answers. At for , nearest rank selects . The usual even-size median averages and to get .
Rule: sort; take rank pn rounded up. Sample: 0, 4, 6, 12. p=0.5. “Average middle values: 5.” Repair.
Show answer and explanation
Rank 2 gives 4.
Sort and follow the supplied rank rule. Under nearest rank, round pn upward and read that observation; another convention may give another answer.
- Locate a quantile under its stated rule.
Sources & further reading
- [1]R Core documentation, Sample Quantiles ↗R Core · Article
- [2]NIST/SEMATECH e-Handbook, 7.2.6.2 Percentiles ↗NIST/SEMATECH · Article