liveBook · Manning

Percentile

As explained in Grokking Statistics

A percentile is a value below which a specified percentage of observations in an ordered dataset falls.

A percentile is a value below which a specified percentage of an ordered dataset falls. It turns a long list of numbers into an interpretable position: the 50th percentile is the median, while the 25th and 75th percentiles mark the first and third quartiles. section 2.15 section 2.12

Use percentiles to read both typical values and the spread of the middle half:

  • The 25th percentile leaves about 25% of observations below it; the 75th leaves about 75% below it. section 2.15
  • Subtracting the 25th percentile from the 75th gives the interquartile range, which summarizes the middle 50% while reducing the effect of outliers. section 2.15
  • A quantile expresses the same idea using a fraction rather than a percentage: quantile = percentile/100. section 2.15

Reading a set of bar tabs

For bar tabs [7, 18, 19, 20, 21, 22, 25, 120, 1500], NumPy gives the 25th, 50th, and 75th percentiles as 19, 21, and 25. Thus, the middle 50% lies between 19 and 25, producing an interquartile range of 6 despite the unusually large tabs. section 2.15

import numpy as np

bar_tabs = [7, 18, 19, 20, 21, 22, 25, 120, 1500]

q25 = np.percentile(bar_tabs, 25)
q50 = np.percentile(bar_tabs, 50)
q75 = np.percentile(bar_tabs, 75)

# 19.0 21.0 25.0
print(q25, q50, q75)

Run the NumPy example to calculate the 25th, 50th, and 75th percentiles. section 2.15

How Grokking Statistics covers it

How deep it goes
Defines percentile, explains quartiles and interquartile range, and notes interpolation without deriving estimation methods.
Examples
Uses bar-tab values to calculate the 25th, 50th, and 75th percentiles and interpret their interquartile range.
What it assumes
Assumes an ordered numerical dataset and teaches percentile terminology, quartiles, and quantiles from basic definitions.
What you can do after
Apply it via NumPy to calculate percentiles and interpret typical values and middle-spread ranges.
How it connects
Connects percentiles with median, quantiles, quartiles, interquartile range, outliers, and descriptive statistics.

Also explained in

Compare how 7 books explain percentile →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Statistics. The section links point to the parts of the book it draws on.