percentile() — Percentiles

The value below which a given percentage of the data falls.

percentile(x, p)

Key idea

How to read a percentile

  1. Sort the data from smallest to largest.
  2. The p-th percentile sits at the p% position up the sorted list — roughly p% of values fall at or below it.
  3. Example: the 90th percentile is the value that 90% of the data lies below, leaving the top 10% above it.
  4. The 50th percentile is the median; the 25th and 75th are the quartiles Q1 and Q3 that define the IQR.

Definition

the percentage you ask about (0–100)
the value at that percentile
the median

In plain words

Line everyone up shortest to tallest. The 90th percentile height is the spot where you’re taller than 9 out of every 10 people.

Where you'd use it

Frequently asked questions

What does the 90th percentile mean?
The value below which 90% of the data fall.
Why does my answer differ from a textbook?
There are several percentile definitions; R has 9 quantile "types".