Percentile
In statistics, a kth percentile (percentile score or centile) is a score below which a given percentage k of scores in its frequency distribution falls (exclusive definition) or a score at or below which a given percentage falls (inclusive definition). For example, the 50th percentile (the median) is the score below which (exclusive) or at or below which (inclusive) 50% of the scores in the distribution may be found.
Percentiles are expressed in the same unit of measurement as the input scores; for example, if the scores refer to human weight, the corresponding percentiles will be expressed in kilograms or pounds.
The percentile score and the percentile rank are related terms. The percentile rank of a score is the percentage of scores in its distribution that are less than it, an exclusive definition, and one that can be expressed with a single, simple formula. Percentile scores and percentile ranks are often used in the reporting of test scores from normreferenced tests, but, as just noted, they are not the same. For percentile rank, a score is given and a percentage is computed. Percentile ranks are exclusive. If the percentile rank for a specified score is 90%, then 90% of the scores were lower. In contrast, for percentiles a percentage is given and a corresponding score is determined, which can be either exclusive or inclusive. The score for a specified percentage (e.g., 90th) indicates a score below which (exclusive definition) or at or below which (inclusive definition) other scores in the distribution fall.
The 25th percentile is also known as the first quartile (Q_{1}), the 50th percentile as the median or second quartile (Q_{2}), and the 75th percentile as the third quartile (Q_{3}).
Applications
When ISPs bill "burstable" internet bandwidth, the 95th or 98th percentile usually cuts off the top 5% or 2% of bandwidth peaks in each month, and then bills at the nearest rate. In this way, infrequent peaks are ignored, and the customer is charged in a fairer way. The reason this statistic is so useful in measuring data throughput is that it gives a very accurate picture of the cost of the bandwidth. The 95th percentile says that 95% of the time, the usage is below this amount: so, the remaining 5% of the time, the usage is above that amount.
Physicians will often use infant and children's weight and height to assess their growth in comparison to national averages and percentiles which are found in growth charts.
The 85th percentile speed of traffic on a road is often used as a guideline in setting speed limits and assessing whether such a limit is too high or low.^{[1]}^{[2]}
In finance, value at risk is a standard measure to assess (in a modeldependent way) the quantity under which the value of the portfolio is not expected to sink within a given period of time and given a confidence value.
The normal distribution and percentiles
The methods given in the definitions section (below) are approximations for use in smallsample statistics. In general terms, for very large populations following a normal distribution, percentiles may often be represented by reference to a normal curve plot. The normal distribution is plotted along an axis scaled to standard deviations, or sigma ([math]\displaystyle{ \sigma }[/math]) units. Mathematically, the normal distribution extends to negative infinity on the left and positive infinity on the right. Note, however, that only a very small proportion of individuals in a population will fall outside the −3σ to +3σ range. For example, with human heights very few people are above the +3σ height level.
Percentiles represent the area under the normal curve, increasing from left to right. Each standard deviation represents a fixed percentile. Thus, rounding to two decimal places, −3σ is the 0.13th percentile, −2σ the 2.28th percentile, −1σ the 15.87th percentile, 0σ the 50th percentile (both the mean and median of the distribution), +1σ the 84.13th percentile, +2σ the 97.72nd percentile, and +3σ the 99.87th percentile. This is related to the 68–95–99.7 rule or the threesigma rule. Note that in theory the 0th percentile falls at negative infinity and the 100th percentile at positive infinity, although in many practical applications, such as test results, natural lower and/or upper limits are enforced.
Definitions
There is no standard definition of percentile,^{[3]}^{[4]}^{[5]} however all definitions yield similar results when the number of observations is very large and the probability distribution is continuous.^{[6]} In the limit, as the sample size approaches infinity, the 100p^{th} percentile (0<p<1) approximates the inverse of the cumulative distribution function (CDF) thus formed, evaluated at p, as p approximates the CDF. This can be seen as a consequence of the Glivenko–Cantelli theorem. Some methods for calculating the percentiles are given below.
Calculation methods
There are many formulas or algorithms^{[7]} for a percentile score. Hyndman and Fan ^{[3]} identified nine and most statistical and spreadsheet software use one of the methods they describe.^{[8]} Algorithms either return the value of a score that exists in the set of scores (nearestrank methods) or interpolate between existing scores and are either exclusive or inclusive.
PC: percentile specified  0.10  0.25  0.50  0.75  0.90 

N: Number of scores  10  10  10  10  10 
OR: ordinal rank = PC × N  1  2.5  5  7.5  9 
Rank: >OR / ≥OR  2/1  3/3  6/5  8/8  10/9 
Score at rank (exc/inc)  2/1  3/3  4/3  5/5  7/5 
The figure shows a 10score distribution, illustrates the percentile scores that result from these different algorithms, and serves as an introduction to the examples given subsequently. The simplest are nearestrank methods that return a score from the distribution, although compared to interpolation methods, results can be a bit crude. The NearestRank Methods table shows the computational steps for exclusive and inclusive methods.
PC: percentile specified  0.10  0.25  0.50  0.75  0.90 

N: number of scores  10  10  10  10  10 
OR: PC×(N+1) / PC×(N−1)+1  1.1/1.9  2.75/3.25  5.5/5.5  8.25/7.75  9.9/9.1 
LoRank: OR truncated  1/1  2/3  5/5  8/7  9/9 
HIRank: OR rounded up  2/2  3/4  6/6  9/8  10/10 
LoScore: score at LoRank  1/1  2/3  3/3  5/4  5/5 
HiScore: score at HiRank  2/2  3/3  4/4  5/5  7/7 
Difference: HiScore − LoScore  1/1  1/0  1/1  0/1  2/2 
Mod: fractional part of OR  0.1/0.9  0.75/0.25  0.5/0.5  0.25/0.75  0.9/0.1 
Interpolated score (exc/inc) = LoScore + Mod × Difference 
1.1/1.9  2.75/3  3.5/3.5  5/4.75  6.8/5.2 
Interpolation methods, as the name implies, can return a score that is between scores in the distribution. Algorithms used by statistical programs typically use interpolation methods, for example, the percentile.exc and percentile.inc functions in Microsoft Excel. The Interpolated Methods table shows the computational steps.
The nearestrank method
One definition of percentile, often given in texts, is that the Pth percentile [math]\displaystyle{ (0 \lt P \le 100) }[/math] of a list of N ordered values (sorted from least to greatest) is the smallest value in the list such that no more than P percent of the data is strictly less than the value and at least P percent of the data is less than or equal to that value. This is obtained by first calculating the ordinal rank and then taking the value from the ordered list that corresponds to that rank. The ordinal rank n is calculated using this formula
 [math]\displaystyle{ n = \left \lceil \frac{P}{100} \times N \right \rceil. }[/math]
Note the following:
 Using the nearestrank method on lists with fewer than 100 distinct values can result in the same value being used for more than one percentile.
 A percentile calculated using the nearestrank method will always be a member of the original ordered list.
 The 100th percentile is defined to be the largest value in the ordered list.
Worked examples of the nearestrank method
 Example 1
Consider the ordered list {15, 20, 35, 40, 50}, which contains 5 data values. What are the 5th, 30th, 40th, 50th and 100th percentiles of this list using the nearestrank method?
Percentile P 
Number in list N 
Ordinal rank n 
Number from the ordered list that has that rank 
Percentile value 
Notes 

5th  5  [math]\displaystyle{ \left\lceil \frac{5}{100} \times 5 \right \rceil = \lceil 0.25 \rceil = 1 }[/math]  the first number in the ordered list, which is 15  15  15 is the smallest element of the list; 0% of the data is strictly less than 15, and 20% of the data is less than or equal to 15. 
30th  5  [math]\displaystyle{ \left\lceil \frac{30}{100} \times 5 \right \rceil = \lceil 1.5 \rceil = 2 }[/math]  the 2nd number in the ordered list, which is 20  20  20 is an element of the ordered list. 
40th  5  [math]\displaystyle{ \left\lceil \frac{40}{100} \times 5 \right \rceil = \lceil 2.0 \rceil = 2 }[/math]  the 2nd number in the ordered list, which is 20  20  In this example, it is the same as the 30th percentile. 
50th  5  [math]\displaystyle{ \left\lceil \frac{50}{100} \times 5 \right \rceil = \lceil 2.5 \rceil = 3 }[/math]  the 3rd number in the ordered list, which is 35  35  35 is an element of the ordered list. 
100th  5  [math]\displaystyle{ \left\lceil \frac{100}{100} \times 5 \right \rceil = \lceil 5 \rceil = 5 }[/math]  the last number in the ordered list, which is 50  50  The 100th percentile is defined to be the largest value in the list, which is 50. 
So the 5th, 30th, 40th, 50th and 100th percentiles of the ordered list {15, 20, 35, 40, 50} using the nearestrank method are {15, 20, 20, 35, 50}.
 Example 2
Consider an ordered population of 10 data values {3, 6, 7, 8, 8, 10, 13, 15, 16, 20}. What are the 25th, 50th, 75th and 100th percentiles of this list using the nearestrank method?
Percentile P 
Number in list N 
Ordinal rank n 
Number from the ordered list that has that rank 
Percentile value 
Notes 

25th  10  [math]\displaystyle{ \left\lceil \frac{25}{100} \times 10 \right \rceil = \lceil 2.5 \rceil = 3 }[/math]  the 3rd number in the ordered list, which is 7  7  7 is an element of the list. 
50th  10  [math]\displaystyle{ \left\lceil \frac{50}{100} \times 10 \right \rceil = \lceil 5.0 \rceil = 5 }[/math]  the 5th number in the ordered list, which is 8  8  8 is an element of the list. 
75th  10  [math]\displaystyle{ \left\lceil \frac{75}{100} \times 10 \right \rceil = \lceil 7.5 \rceil = 8 }[/math]  the 8th number in the ordered list, which is 15  15  15 is an element of the list. 
100th  10  Last  20, which is the last number in the ordered list  20  The 100th percentile is defined to be the largest value in the list, which is 20. 
So the 25th, 50th, 75th and 100th percentiles of the ordered list {3, 6, 7, 8, 8, 10, 13, 15, 16, 20} using the nearestrank method are {7, 8, 15, 20}.
 Example 3
Consider an ordered population of 11 data values {3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20}. What are the 25th, 50th, 75th and 100th percentiles of this list using the nearestrank method?
Percentile P 
Number in list N 
Ordinal rank n 
Number from the ordered list that has that rank 
Percentile value 
Notes 

25th  11  [math]\displaystyle{ \left\lceil \frac{25}{100} \times 11 \right \rceil = \lceil 2.75 \rceil = 3 }[/math]  the 3rd number in the ordered list, which is 7  7  7 is an element of the list. 
50th  11  [math]\displaystyle{ \left\lceil \frac{50}{100} \times 11 \right \rceil = \lceil 5.50 \rceil = 6 }[/math]  the 6th number in the ordered list, which is 9  9  9 is an element of the list. 
75th  11  [math]\displaystyle{ \left\lceil \frac{75}{100} \times 11 \right \rceil = \lceil 8.25 \rceil = 9 }[/math]  the 9th number in the ordered list, which is 15  15  15 is an element of the list. 
100th  11  Last  20, which is the last number in the ordered list  20  The 100th percentile is defined to be the largest value in the list, which is 20. 
So the 25th, 50th, 75th and 100th percentiles of the ordered list {3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20} using the nearestrank method are {7, 9, 15, 20}.
The linear interpolation between closest ranks method
An alternative to rounding used in many applications is to use linear interpolation between adjacent ranks.
Commonalities between the variants of this method
All of the following variants have the following in common. Given the order statistics
 [math]\displaystyle{ \{v_i,i=1,2,\ldots,N : v_{i+1}\ge v_i,\forall i=1,2,\ldots,N1\}, }[/math]
we seek a linear interpolation function that passes through the points [math]\displaystyle{ (v_i,i) }[/math]. This is simply accomplished by
 [math]\displaystyle{ v(x) = v_{\lfloor x\rfloor} + (x \bmod 1)(v_{\lfloor x\rfloor+1}v_{\lfloor x\rfloor}),\forall x\in[1,N] : v(i)=v_i \text{, for } i=1,2,\ldots,N, }[/math]
where [math]\displaystyle{ \lfloor x\rfloor }[/math] uses the floor function to represent the integral part of positive x, whereas [math]\displaystyle{ x\bmod 1 }[/math] uses the mod function to represent its fractional part (the remainder after division by 1). (Note that, though at the endpoint [math]\displaystyle{ x = N }[/math], [math]\displaystyle{ v_{\lfloor x\rfloor+1} }[/math] is undefined, it does not need to be because it is multiplied by [math]\displaystyle{ x \bmod 1 = 0 }[/math].) As we can see, x is the continuous version of the subscript i, linearly interpolating v between adjacent nodes.
There are two ways in which the variant approaches differ. The first is in the linear relationship between the rank x, the percent rank [math]\displaystyle{ P=100p }[/math], and a constant that is a function of the sample size N:
 [math]\displaystyle{ x=f(p,N)=(N+c_1)p+c_2. }[/math]
There is the additional requirement that the midpoint of the range [math]\displaystyle{ (1,N) }[/math], corresponding to the median, occur at [math]\displaystyle{ p=0.5 }[/math]:
 [math]\displaystyle{ \begin{align} f(0.5,N)&=\frac{N+c_1}{2}+c_2=\frac{N+1}{2}\\ \therefore 2c_2+c_1&=1 \end{align}, }[/math]
and our revised function now has just one degree of freedom, looking like this:
 [math]\displaystyle{ x=f(p,N)=(N+12C)p+C. }[/math]
The second way in which the variants differ is in the definition of the function near the margins of the [math]\displaystyle{ [0,1] }[/math] range of p: [math]\displaystyle{ f(p,N) }[/math] should produce, or be forced to produce, a result in the range [math]\displaystyle{ [1,N] }[/math], which may mean the absence of a onetoone correspondence in the wider region. One author has suggested a choice of [math]\displaystyle{ C = \tfrac{1}{2} (1+\xi) }[/math] where ξ is the shape of the Generalized extreme value distribution which is the extreme value limit of the sampled distribution.
First variant, C = 1/2
(Sources: Matlab "prctile" function,^{[9]}^{[10]})
 [math]\displaystyle{ x=f(p)=\begin{cases} Np+\frac{1}{2},\forall p\in\left [p_1,p_N\right ], \\ 1,\forall p\in\left [0,p_1\right ], \\ N,\forall p\in\left [p_N,1\right ]. \end{cases} }[/math]
where
 [math]\displaystyle{ p_i=\frac{1}{N}\left(i\frac{1}{2}\right),i\in[1,N]\cap\mathbb{N} }[/math]
 [math]\displaystyle{ \therefore p_1=\frac{1}{2N}, p_N=\frac{2N1}{2N}. }[/math]
Furthermore, let
 [math]\displaystyle{ P_i=100p_i. }[/math]
The inverse relationship is restricted to a narrower region:
 [math]\displaystyle{ p=\frac{1}{N}\left(x\frac{1}{2}\right),x\in(1,N)\cap\mathbb{R}. }[/math]
Worked example of the first variant
Consider the ordered list {15, 20, 35, 40, 50}, which contains five data values. What are the 5th, 30th, 40th and 95th percentiles of this list using the Linear Interpolation Between Closest Ranks method? First, we calculate the percent rank for each list value.
List value [math]\displaystyle{ v_i }[/math] 
Position of that value in the ordered list i 
Number of values N 
Calculation of percent rank 
Percent rank, [math]\displaystyle{ P_i }[/math] 

15  1  5  [math]\displaystyle{ \frac{100}{5}\left(1\frac{1}{2}\right)=10. }[/math]  10 
20  2  5  [math]\displaystyle{ \frac{100}{5}\left(2\frac{1}{2}\right)=30. }[/math]  30 
35  3  5  [math]\displaystyle{ \frac{100}{5}\left(3\frac{1}{2}\right)=50. }[/math]  50 
40  4  5  [math]\displaystyle{ \frac{100}{5}\left(4\frac{1}{2}\right)=70. }[/math]  70 
50  5  5  [math]\displaystyle{ \frac{100}{5}\left(5\frac{1}{2}\right)=90. }[/math]  90 
Then we take those percent ranks and calculate the percentile values as follows:
Percent rank P 
Number of values N 
Is [math]\displaystyle{ P \lt P_1 }[/math]?  Is [math]\displaystyle{ P \gt P_n }[/math]?  Is there a percent rank equal to P? 
What do we use for percentile value?  Percentile value [math]\displaystyle{ v(f(p)) }[/math] 
Notes 

5  5  Yes  No  No  We see that [math]\displaystyle{ P=5 }[/math], which is less than the first percent rank [math]\displaystyle{ p_1=10 }[/math], so use the first list value [math]\displaystyle{ v_1 }[/math], which is 15  15  15 is a member of the ordered list 
30  5  No  No  Yes  We see that [math]\displaystyle{ P=30 }[/math] is the same as the second percent rank [math]\displaystyle{ p_2=30 }[/math], so use the second list value [math]\displaystyle{ v_2 }[/math], which is 20  20  20 is a member of the ordered list 
40  5  No  No  No  We see that [math]\displaystyle{ P=40 }[/math] is between percent rank [math]\displaystyle{ p_2=30 }[/math] and [math]\displaystyle{ p_3=50 }[/math], so we take
Given those values we can then calculate v as follows:

27.5  27.5 is not a member of the ordered list 
95  5  No  Yes  No  We see that [math]\displaystyle{ P=95 }[/math], which is greater than the last percent rank [math]\displaystyle{ p_N=90 }[/math], so use the last list value, which is 50  50  50 is a member of the ordered list 
So the 5th, 30th, 40th and 95th percentiles of the ordered list {15, 20, 35, 40, 50} using the Linear Interpolation Between Closest Ranks method are {15, 20, 27.5, 50}
Second variant, C = 1
(Source: Some software packages, including NumPy^{[11]} and Microsoft Excel^{[5]} (up to and including version 2013 by means of the PERCENTILE.INC function). Noted as an alternative by NIST^{[8]})
 [math]\displaystyle{ x = f(p,N) = p(N1)+1 \text{, } p\in[0,1] }[/math]
 [math]\displaystyle{ \therefore p = \frac{x1}{N1} \text{, } x\in[1,N]. }[/math]
Note that the [math]\displaystyle{ x\leftrightarrow p }[/math] relationship is onetoone for [math]\displaystyle{ p\in[0,1] }[/math], the only one of the three variants with this property; hence the "INC" suffix, for inclusive, on the Excel function.
Worked examples of the second variant
Example 1
Consider the ordered list {15, 20, 35, 40, 50}, which contains five data values. What is the 40th percentile of this list using this variant method?
First we calculate the rank of the 40th percentile:
 [math]\displaystyle{ x = \frac{40}{100}(51)+1=2.6 }[/math]
So, x=2.6, which gives us [math]\displaystyle{ \lfloor x\rfloor=2 }[/math] and [math]\displaystyle{ x\bmod 1=0.6 }[/math]. So, the value of the 40th percentile is
 [math]\displaystyle{ v(2.6) = v_2+0.6(v_3v_2) = 20+0.6(3520) = 29. }[/math]
Example 2
Consider the ordered list {1,2,3,4} which contains four data values. What is the 75th percentile of this list using the Microsoft Excel method?
First we calculate the rank of the 75th percentile as follows:
 [math]\displaystyle{ x = \frac{75}{100}(41)+1=3.25 }[/math]
So, x=3.25, which gives us an integral part of 3 and a fractional part of 0.25. So, the value of the 75th percentile is
 [math]\displaystyle{ v(3.25) = v_3+0.25(v_4v_3) = 3+0.25(43) = 3.25. }[/math]
Third variant, C = 0
(The primary variant recommended by NIST.^{[8]} Adopted by Microsoft Excel since 2010 by means of PERCENTIL.EXC function. However, as the "EXC" suffix indicates, the Excel version excludes both endpoints of the range of p, i.e., [math]\displaystyle{ p\in(0,1) }[/math], whereas the "INC" version, the second variant, does not; in fact, any number smaller than [math]\displaystyle{ \frac 1 {N+1} }[/math] is also excluded and would cause an error.)
 [math]\displaystyle{ x = f(p,N) = \begin{cases} 1\text{, }p\in\left[0,\frac{1}{N+1}\right] \\ p(N+1)\text{, }p\in\left(\frac{1}{N+1},\frac{N}{N+1}\right) \\ N\text{, }p\in\left[\frac{N}{N+1},1\right] \end{cases}. }[/math]
The inverse is restricted to a narrower region:
 [math]\displaystyle{ p = \frac{x}{N+1}\text{, }x\in(0,N). }[/math]
Worked example of the third variant
Consider the ordered list {15, 20, 35, 40, 50}, which contains five data values. What is the 40th percentile of this list using the NIST method?
First we calculate the rank of the 40th percentile as follows:
 [math]\displaystyle{ x = \frac{40}{100}(5+1)=2.4 }[/math]
So x=2.4, which gives us [math]\displaystyle{ \lfloor x\rfloor=2 }[/math] and [math]\displaystyle{ x\bmod 1=0.4 }[/math]. So the value of the 40th percentile is calculated as:
 [math]\displaystyle{ v(2.4) = v_2+0.4(v_3v_2) = 20+0.4(3520) = 26 }[/math]
So the value of the 40th percentile of the ordered list {15, 20, 35, 40, 50} using this variant method is 26.
The weighted percentile method
In addition to the percentile function, there is also a weighted percentile, where the percentage in the total weight is counted instead of the total number. There is no standard function for a weighted percentile. One method extends the above approach in a natural way.
Suppose we have positive weights [math]\displaystyle{ w_1, w_2, w_3, \dots, w_N }[/math] associated, respectively, with our N sorted sample values. Let
 [math]\displaystyle{ S_N = \sum_{k=1}^N w_k, }[/math]
the sum of the weights. Then the formulas above are generalized by taking
 [math]\displaystyle{ p_n = \frac{1}{S_N}\left(S_n  \frac{w_n}{2}\right) }[/math] when [math]\displaystyle{ C=1/2 }[/math],
or
 [math]\displaystyle{ p_n = \frac{S_n  Cw_n}{S_N +(12C)w_n} }[/math] for general [math]\displaystyle{ C }[/math],
and
 [math]\displaystyle{ v = v_k + \frac{P  p_k}{p_{k + 1}  p_k}(v_{k + 1}  v_k). }[/math]
The 50% weighted percentile is known as the weighted median.
See also
 Quantile
 Decile
 Summary statistics
 Percentile rank
References
 ↑ Johnson, Robert; Kuby, Patricia (2007), "Applied Example 2.15, The 85th Percentile Speed Limit: Going With 85% of the Flow", Elementary Statistics (10th ed.), Cengage Learning, p. 102, ISBN 9781111802493, https://books.google.com/books?id=vb8GAAAAQBAJ&pg=PA102.
 ↑ "Rational Speed Limits and the 85th Percentile Speed". Louisiana State Police. http://www.lsp.org/pdf/troopc85thSpeed.pdf.
 ↑ ^{3.0} ^{3.1} Hyndman, Rob J.; Fan, Yanan (November 1996). "Sample Quantiles in Statistical Packages". American Statistician (American Statistical Association) 50 (4): 361–365. doi:10.2307/2684934. https://www.researchgate.net/publication/222105754.
 ↑ Lane, David. "Percentiles". http://cnx.org/content/m10805/latest.
 ↑ ^{5.0} ^{5.1} Pottel, Hans. "Statistical flaws in Excel". http://nestor.coventry.ac.uk/~nhunt/pottel.pdf.
 ↑ "Estimation of population percentiles". Epidemiology 22 (5): 750–751. 2011. doi:10.1097/EDE.0b013e318225c1de. PMID 21811118.
 ↑ Wessa, P (2021). "Percentiles in Free Statistics Software". Office for Research Development and Education. http://www.wessa.net/rwasp_percentiles.wasp/.
 ↑ ^{8.0} ^{8.1} ^{8.2} "Engineering Statistics Handbook: Percentile". NIST. http://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm.
 ↑ "Matlab Statistics Toolbox – Percentiles". http://www.mathworks.com/access/helpdesk/help/toolbox/stats/prctile.html., This is equivalent to Method 5 discussed here
 ↑ Langford, E. (2006). "Quartiles in Elementary Statistics". Journal of Statistics Education 14 (3). doi:10.1080/10691898.2006.11910589.
 ↑ "NumPy 1.12 documentation". SciPy. https://docs.scipy.org/doc/numpy/reference/generated/numpy.percentile.html.
Original source: https://en.wikipedia.org/wiki/ Percentile.
Read more 