Tutorials › Introduction to Statistics › Finding Percentiles With the Nearest-Rank Rule

Center, Spread and Position · Tutorial 171 of 996

Finding Percentiles With the Nearest-Rank Rule

Use the nearest-rank rule to find percentile values, understand what the selected rank guarantees, and handle ties and percentile levels near the boundaries.

Beginner 9 min read

What You'll Learn

  • Order observations and calculate the nearest-rank position for a requested percentile.
  • Explain why the rank is rounded up rather than rounded to the nearest integer.
  • Interpret the selected value when several observations are tied.
  • Apply the rule to small samples, where percentile ranks change in large steps.
  • Handle the 0th and 100th percentiles consistently.

What Does It Mean to Find a Percentile?

A percentile value describes a position in an ordered set of observations. For example, finding the 75th percentile of a set of test scores means locating a score with at least about 75% of the observations at or below it, according to a specified rule. The rule matters: different conventions can produce different percentile values from the same data. Here we use the nearest-rank rule, which selects an observed value at a particular rank and does not calculate a value between observations.

This method is straightforward to apply, including when the sample is small or contains repeated values. Its results can be somewhat coarse in a small sample, and ties can make the proportion at or below the selected value greater than the requested percentage.

Definition: Arrange \(n\) observations in nondecreasing order and write them as \(x_{(1)}, x_{(2)}, \ldots, x_{(n)}\), where \(x_{(1)}\) is the smallest and \(x_{(n)}\) is the largest. For a percentile level \(p\) with \(0<p\leq 100\), the nearest-rank position is $$ r=\left\lceil \frac{p}{100}n \right\rceil. $$ The nearest-rank \(p\)th percentile is the observation \(x_{(r)}\). The ceiling symbol \(\lceil a\rceil\) means the smallest integer greater than or equal to \(a\). By convention, the 0th percentile is the minimum, \(x_{(1)}\).

The percentile level \(p\) is written as a percentage in the formula. Equivalently, if \(q=p/100\) is the percentile expressed as a proportion, the position is \(r=\lceil qn\rceil\). For example, use \(q=0.75\) for the 75th percentile, not \(q=75\).

Once the rank has been found, the answer is the observation at that position in the ordered data. The rule does not ask us to round the observation, nor does it ask us to average neighboring observations. If the selected position is six, select the sixth observation even if the calculation \(pn/100\) was not a whole number.

Why the Rank Is Rounded Up

The nearest-rank rule uses a ceiling, not ordinary rounding to the nearest whole number. Its purpose is to select the first rank that is large enough to reach the requested fraction of the sample. Let \(q=p/100\), and suppose \(0<q\leq 1\). The selected rank \(r=\lceil qn\rceil\) satisfies

$$ r-1<qn\leq r. $$

Dividing by \(n\), which is positive, gives \((r-1)/n<q\leq r/n\). Thus, the selected rank reaches or exceeds the requested fraction, while the preceding rank does not. Since the observation at position \(r\) has at least the first \(r\) observations at or below it, at least a fraction \(r/n\), and therefore at least \(q\), of the data are at or below the selected value. This explains why rounding down could fall short and why rounding to the nearest integer is not the rule.

When observations are tied, more than \(r\) observations may be at or below \(x_{(r)}\). The rank formula still selects \(x_{(r)}\); it does not move the selected value or divide a tie into parts.

Worked Example: Finding the 75th Percentile With Ties

Suppose eight hypothetical quiz scores, already arranged from least to greatest, are \(2, 4, 4, 5, 7, 7, 7, 9\) points. Find the nearest-rank 75th percentile.

Find the position. Here \(n=8\) and \(p=75\), so

$$ r=\left\lceil \frac{75}{100}\times 8 \right\rceil =\lceil 6\rceil=6. $$

Select the observation. The sixth score is 7 points, so the nearest-rank 75th percentile is 7 points. The score 7 occupies positions five, six, and seven. Consequently, seven of the eight scores are at or below 7: \(7/8=0.875\), or 87.5%. The proportion exceeds 75% because all three observations tied at 7 are included.

The rank calculation selects position six; it does not mean that exactly six observations must be at or below the selected value. Ties can make that count larger.

Small Samples and Coarse Ranks

In a small sample, each observation represents a relatively large fraction of the data. The possible ranks are whole numbers only, so some percentile levels select the same observation. This is a feature of the nearest-rank rule, not an arithmetic error.

Worked Example: A Percentile in a Five-Observation Sample

A hypothetical set of five waiting times, in minutes, is \(12, 15, 18, 21, 30\). Find the nearest-rank 40th percentile.

Find the position. With \(n=5\) and \(p=40\),

$$ r=\left\lceil \frac{40}{100}\times 5 \right\rceil =\lceil 2\rceil=2. $$

Read the ordered data. The second waiting time is 15 minutes. The nearest-rank 40th percentile is therefore 15 minutes. Two of the five waiting times are at or below 15 minutes, and \(2/5=0.40\), or 40%.

For comparison, the nearest-rank 50th percentile in these same data uses \(r=\lceil 0.50\times5\rceil=\lceil2.5\rceil=3\), giving 18 minutes. The rank changes from two to three between these percentile levels because ranks must be whole numbers. Do not interpolate between the second and third observations when applying this rule.

The small-sample effect is especially clear at low percentile levels. If \(n=5\), then for any \(p\) satisfying \(0<p\leq20\), \(0<5p/100\leq1\), so the ceiling is 1. Every such percentile level selects the minimum. The data contain only five ranks, so the rule cannot place a selected observation at every possible percentage point.

Boundary Percentiles

At the upper boundary, \(p=100\) works directly in the formula: \(r=\lceil n\rceil=n\), so the 100th percentile is the maximum. At the lower boundary, \(p=0\) would give rank zero, which is not a valid observation position. That is why the rule defines the 0th percentile separately as the minimum. For \(p>0\), even a very small percentile level selects at least the first observation because the ceiling of a positive number less than or equal to one is one.

Worked Example: Checking the 0th and 100th Percentiles

Four hypothetical daily temperatures, in degrees Celsius, are \(3, 5, 8, 14\), in increasing order. Find the 0th, 1st, and 100th percentiles.

0th percentile. By the boundary convention, this is the minimum: 3°C. Substituting zero into the usual rank formula would give rank zero, so the convention is necessary.

1st percentile. Here \(n=4\), so

$$ r=\left\lceil \frac{1}{100}\times 4\right\rceil =\lceil0.04\rceil=1. $$

The first observation is 3°C. For this small sample, the 1st percentile and the 0th percentile are both 3°C.

100th percentile. The position is

$$ r=\left\lceil \frac{100}{100}\times 4\right\rceil =\lceil4\rceil=4. $$

The fourth observation is 14°C, the maximum. Thus, the 100th percentile is 14°C.

A Reliable Calculation Process

The following steps keep the ordering, rank calculation, and interpretation distinct. Use all observations in the data set being summarized, and retain their original units when reporting the percentile value.

1
Order the observations.
List all \(n\) values from smallest to largest, keeping repeated values in their positions.
2
Calculate the rank.
For \(0<p\leq100\), compute \(r=\lceil(p/100)n\rceil\). For \(p=0\), use rank one by the boundary convention.
3
Select the value at that rank.
The nearest-rank percentile is \(x_{(r)}\), the observation in position \(r\) in the ordered list.
4
Report and interpret it.
Give the value with its units, and state that at least the requested percentage of observations are at or below it. If ties cause a larger proportion to be at or below it, say so.

Common Mistakes and Why This Method Matters

A percentile value is useful for describing the location of an observation in a data set, but it is meaningful only when the rule used to calculate it is clear. Statistical software may use other conventions; a result from a different convention need not match the nearest-rank result. Here, the rank formula and the selected ordered observation define the calculation.

  • Rounding the rank to the nearest integer. This is not the nearest-rank rule. Use the ceiling. For instance, a calculated rank of 2.5 becomes rank 3, not rank 2.
  • Choosing a value between observations. The nearest-rank rule selects an observed value. Do not average or interpolate between two positions.
  • Assuming the requested percentage is exact. With ties, the percentage at or below the selected value can be greater than \(p\). In the eight-score example, it is 87.5%, not exactly 75%.
  • Using rank zero for the 0th percentile. Rank zero is not a position in the data. Use the minimum for the 0th percentile.
  • Forgetting the units or context. Report, for example, “the 75th percentile is 7 points,” rather than giving an unexplained number.
Key takeaway: For \(0<p\leq100\), order the \(n\) observations and select position \(\lceil(p/100)n\rceil\). The selected observation is the nearest-rank \(p\)th percentile. Use the minimum for the 0th percentile, and remember that ties can make more than \(p\)% of the observations lie at or below the selected value.

Check Your Understanding

For each question, use the nearest-rank rule and state the selected value with its units where relevant.

  1. For the ordered data \(4, 6, 9, 11, 15, 20\), what is the nearest-rank 50th percentile? Show the rank calculation.
  2. For the same six observations, what is the nearest-rank 25th percentile? Why is the rank rounded up?
  3. In the ordered data \(1, 3, 3, 3, 8\), find the nearest-rank 60th percentile. How many observations are at or below the selected value?
  4. For the ordered measurements \(2, 7, 10\) seconds, what are the 0th and 100th percentiles?
  5. If \(n=4\), which rank is selected for the 10th percentile, and why can that result seem coarse?