Contents/ Part II · Describing Data/ Chapter 10

Measures of Position

Center and spread describe a dataset as a whole. Position zooms in on a single value and asks: where does this one sit relative to everyone else?

⏱️ ~11 min read
🐍 Notebook included
📊 Chapter 10

"You scored in the 90th percentile." That single phrase says nothing about the average or the spread, it tells you exactly where you stand in the crowd. That is a measure of position.

%
A measure of position locates a single value within a dataset by its rank. The main tools are percentiles (and their inverse, the percentile rank), along with quartiles and deciles.
🔄
Same tools, a new question

In the Measures of Dispersion chapter we used quartiles to measure spread (the IQR). Here we use the same machinery backwards, to locate a single value. The gap Q3 − Q1 was our spread measure; now Q1 itself is a landmark on the map.

1

Percentiles & Percentile Rank

These two are constantly confused, so pin them down. They are inverse operations:

Percentile (a value)

A cut point: the value at a given position.

  • "The 90th percentile is a score of 1350."
  • Question: what value sits here?
%Percentile rank (a %)

A percentage: how much of the data is at or below a value.

  • "A score of 1350 has a rank of 90."
  • Question: what position does this value hold?

One picture shows both at once. Plot the cumulative percentage (how much of the data is at or below each value) and you get a rising S-curve, the ogive. Read up from a value to get its rank; read across from a percentage to get the percentile:

0%50%100% a value its percentile rank Score → Cumulative % (at or below) ogive
The cumulative S-curve ties value and rank together: trace up from a score to read its rank, or across from a percentage to read the score at that percentile.
2

Quartiles, Deciles & Quantiles

Quartiles and deciles are not separate topics, they are just percentiles at round numbers. The umbrella word is quantile: a cut point that divides sorted data into equal-sized groups.

Quartiles

Cut into 4 parts at the 25th, 50th, 75th percentiles (Q1, Q2, Q3).

Deciles

Cut into 10 parts at the 10th, 20th, … 90th percentiles.

Percentiles

Cut into 100 parts, the finest standard grain.

🎯
They all meet at the median

The median is the 50th percentile = 2nd quartile (Q2) = 5th decile, the same point named three ways. And the five-number summary (min, Q1, median, Q3, max) is just the 0th, 25th, 50th, 75th, and 100th percentiles, a quick position map of the whole dataset.

3

Percentiles in the Real World

Position is how the world reports where you stand:

📝

Standardized tests

"1350, the 90th percentile" means about 90% scored at or below you.

👶

Growth charts

A baby in the 25th percentile for weight is at or above 25% of peers.

💵

Income brackets

"The top 1%" is the 99th percentile of income, a position, not an amount.

⚠️
Two interpretation traps

"90th percentile" is not "90% correct." It is a ranking relative to others, not a grade out of 100. And a higher percentile is not automatically "better": a child steady at the 25th percentile is perfectly healthy. For growth, the trend over time matters far more than any single number.

4

Two Things Worth Knowing

🔧
There isn't one "right" percentile on small data

When a percentile falls between two data points, software has to choose how to fill the gap. Some methods snap to the nearest actual value (nearest-rank), others blend the two neighbors (linear interpolation, NumPy's default). Excel, R, and calculators can each report slightly different quartiles for the same small dataset. None is wrong, just report your method.

🛡️
Position measures are robust

Because percentiles depend only on rank order, not on how extreme a value is, a single billionaire barely nudges the median income or the quartiles, even though it would send the mean soaring. That is why skewed data (income, home prices) is described with percentiles.

There is one more way to express position, how many standard deviations a value sits from the mean (the z-score). Unlike percentiles, it is built on the mean and SD and shines for bell-shaped data. We get to it in the Standardization chapter.

5

Position in Machine Learning & AI

Locating a value within its distribution, its percentile or z-score, is exactly what several standard preprocessing steps and monitoring rules do under the hood.

Measure of positionWhere it shows up in MLWhy
z-scoreStandardization (StandardScaler): the position of each value in SD unitsMost models need features centered and scaled, and the z-score is precisely that position
Quartiles / IQRRobust scaling (RobustScaler) and quantile binningScaling by the IQR instead of the SD resists outliers; binning by quantile makes equal-sized groups
Percentile rankAnomaly thresholds and service-level targets (p95, p99 latency)Flagging the top 1% or reporting the 95th-percentile response time are percentile rules by another name
🤖
Percentiles are how systems set alarms

When a dashboard reports p95 latency or a monitor fires on the top 0.1% of transaction amounts, it is using percentile rank as a threshold. Position turns a raw number into a decision: is this value normal, or is it out at the tail where you should act?

6

Real-World Example: Exam Scores and Percentile Ranks

Position is what turns a bare test score into something meaningful. On this set of 400 exam scores, a raw 85 means little on its own, but knowing it sits at the 92nd percentile (a z-score of about +1.4) tells the whole story. The companion notebook finds the quartiles, the IQR, and any score's percentile rank and z-score.

📂 Dataset · measures-of-position--exam_scores.xlsx

One row per student: student_id, cohort (Morning or Evening), and exam_score out of 100. A small group of low scorers gives a mild left tail, so the quartiles and percentile ranks describe the class more faithfully than the average alone.

🐍

Bring it to life in Python

The companion notebook does the value↔rank round trip, computes quartiles and deciles, draws the cumulative S-curve, shows position resisting an outlier, and compares percentile calculation methods.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub

View opens the rendered notebook instantly (no setup). Open in Colab runs & edits it live in your browser. To run locally, install numpy, pandas, matplotlib and launch jupyter notebook.

🎓 Key Takeaways

  • Measures of position locate a single value within the data by its rank.
  • Percentile (a value) and percentile rank (a %) are inverse operations.
  • Quartiles, deciles, percentiles are all quantiles; the median is the 50th percentile = Q2 = 5th decile.
  • "90th percentile" is a ranking, not a grade, and a higher percentile is not always "better."
  • Percentiles are robust to outliers, but calculation methods can differ on small samples.
7

Practice Challenges

Five short challenges. Beginner to intermediate; try them on paper or in Python. Several use this dataset: [55, 60, 62, 68, 70, 72, 75, 80, 85, 90].

1

Percentile rank

For the dataset above, what is the percentile rank of the score 70 (the percent of scores at or below it)?

Hint: count how many values are ≤ 70, divide by 10.
2

Percentile value

What score sits at the 80th percentile of the same dataset?

Hint: this is the reverse of Challenge 1; let np.percentile do it.
3

Quartiles & a decile

Find Q1, the median (Q2), Q3, and the 3rd decile (30th percentile) of the dataset.

Hint: quartiles are the 25/50/75th percentiles; the 3rd decile is the 30th.
4

Interpret it correctly

A pediatrician says a toddler is in the 30th percentile for height. What does that mean, and is it a problem?

Hint: it's a ranking vs. other kids, not a 30% grade. Think about the trend.
5

Two valid answers

For [3, 6, 9, 12], compute the first quartile (25th percentile) two ways: NumPy's "lower" method and its default "linear" method. Why do they differ?

Hint: the 25% mark falls between two data points.
Check your work

A fully-worked solutions notebook walks through all five challenges in the same visual style. Try them yourself first, then compare.

📓 View Solutions ▶ Open Solutions in Colab ⬇ View / Download on GitHub
8

Quiz: Test Yourself

Eight quick questions on position. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.