percentile() — Percentiles
The value below which a given percentage of the data falls.
percentile(x, p)
Key idea
- The p-th percentile is the value with about p% of the data at or below it. (e.g. P90 = 89 -> 90% scored 89 or less)
- Being "in the 90th percentile" means 90% are below you — not that you scored 90%.
- Quartiles (the four-way cut points) are special percentiles: Q1 = 25th, median = 50th, Q3 = 75th.
- To find it, sort the data and read off the value at the p% position.
How to read a percentile
- Sort the data from smallest to largest.
- The p-th percentile sits at the p% position up the sorted list — roughly p% of values fall at or below it.
- Example: the 90th percentile is the value that 90% of the data lies below, leaving the top 10% above it.
- The 50th percentile is the median; the 25th and 75th are the quartiles Q1 and Q3 that define the IQR.
Definition
Pp=the value with p% of the data at or below it
- p
- the percentage you ask about (0–100)
- Pp
- the value at that percentile
- P50
- the median
P90=89.2⇒90% of values are at or below 89.2
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
- A baby is in the 75th percentile for weight — heavier than 75% of babies that age.
- Engineers track
p95 latency — the response time that 95% of requests come in under. - A test report says you’re in the 88th percentile: 88% of test-takers scored below you.
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".