01 / 20

Percentiles &
Interquartile Range

Learn to compute and interpret percentiles and the IQR: essential tools for summarizing data spread in biostatistics.

Biostatistics

Why Do Percentiles Matter?

When a doctor tells you a child is in the 85th percentile for height, they mean the child is taller than 85% of children the same age. Percentiles convert raw data into a relative ranking that is easy to interpret.

In biostatistics, percentiles help us define reference ranges (e.g., normal blood pressure), identify outliers, and compare individuals to a population: all without assuming a specific distribution shape.

Defining the \(k\)-th Percentile

The \(k\)-th percentile (\(P_k\)) is the value below which \(k\)% of the data falls when the data are sorted in ascending order.

\(P_{25}\)
25th percentile: 25% of data lies below this value. Also called \(Q_1\).
\(P_{50}\)
50th percentile: the median. Half the data is below, half above.
\(P_{75}\)
75% of data lies below this value. Also called \(Q_3\).

Visualizing Quartiles on Data

2 4 5 7 8 10 12 14 15 18 20 22
\(Q_1 = 6\)
\(Q_2 = 11\)
\(Q_3 = 16.5\)
\(\text{IQR} = 16.5 - 6 = 10.5\)
Lower 25% Middle 50% Upper 25%

Formal Definitions

IQR Formula
$$ \text{IQR} = Q_3 - Q_1 $$
Locator Formula
$$ L = \frac{k}{100} \times n $$

The Locator Method

There are several conventions for computing percentiles. A common textbook method uses the locator formula:

1
Sort the dataset in ascending order.
2
Compute the locator: \( L = \frac{k}{100} \times n \).
3
If \(L\) is not a whole number, round up to the next integer. The \(k\)-th percentile is the value at that position.
4
If \(L\) is a whole number, the percentile is the average of the \(L\)-th and \((L+1)\)-th values.

Percentile vs Percentile Rank

Percentile Percentile Rank
Question it answers What value is at the \(k\)-th position? What percent of data falls at or below \(x\)?
Input A percentage \(k\) A data value \(x\)
Output A data value A percentage
Example \(P_{75} = 16.5\) A blood pressure of \(110 \text{ mmHg}\) is at the 40th percentile.

How to Compute \(Q_1\), \(Q_3\), and \(\text{IQR}\)

1
Sort all \(n\) data values from smallest to largest.
2
Find \(Q_1\) (25th percentile): Compute \(L = \frac{25}{100} \times n\). Use the locator rules to find the value.
3
Find \(Q_3\) (75th percentile): Compute \(L = \frac{75}{100} \times n\). Use the locator rules to find the value.
4
Compute \(\text{IQR}\): \( \text{IQR} = Q_3 - Q_1 \).

Worked Example: Even Dataset

Dataset (resting heart rates in \(\text{bpm}\), already sorted):
58, 60, 63, 65, 68, 70, 72, 74, 78, 82

1
The data is sorted, and there are \(n=10\) values.
2
Find \(Q_1\): Compute \(L = \frac{25}{100} \times 10 = 2.5\). Round up to 3. The 3rd value is 63.
3
Find \(Q_3\): Compute \(L = \frac{75}{100} \times 10 = 7.5\). Round up to 8. The 8th value is 74.
4
Compute \(\text{IQR}\): \(\text{IQR} = Q_3 - Q_1 = 74 - 63 = \) \(11 \text{ bpm}\).

Box Plot: Heart Rate Data

55 60 65 70 75 80 85
\(\text{Min}=58\)
\(Q_1=63\)
\(\text{Median}=69\)
\(Q_3=74\)
\(\text{Max}=82\)
\(\text{IQR} = 11\)

Worked Example: Odd Dataset

Dataset (blood glucose levels in \(\text{mg/dL}\), sorted):
78, 82, 85, 90, 95, 100, 105, 112, 130

1
Find \(Q_1\): \(L = \frac{25}{100} \times 9 = 2.25\). Round up to 3. The 3rd value is 85.
2
Find \(Q_3\): \(L = \frac{75}{100} \times 9 = 6.75\). Round up to 7. The 7th value is 105.
3
Compute \(\text{IQR}\): \(105 - 85 = \) \(20 \text{ mg/dL}\).

Worked Example: \(90\)-th Percentile

Using the same heart rate data:
58, 60, 63, 65, 68, 70, 72, 74, 78, 82

1
We want \(P_{90}\). Compute: \(L = \frac{90}{100} \times 10 = 9\).
2
\(L = 9\) is a whole number, so average positions 9 and 10: \(P_{90} = \frac{x_9 + x_{10}}{2} = \frac{78 + 82}{2} = \) 80.

IQR and Outlier Detection

The IQR is the foundation of the \(1.5 \times \text{IQR}\) rule for identifying outliers. A value is a potential outlier if it falls outside the fences:

Lower Fence
$$ Q_1 - 1.5 \times \text{IQR} $$
Upper Fence
$$ Q_3 + 1.5 \times \text{IQR} $$

Why Use IQR Over Range?

IQR Range
Definition \(Q_3 - Q_1\) \(\text{Max} - \text{Min}\)
Sensitivity to outliers Resistant Very sensitive
Data used Middle 50% Only 2 extreme values
Best for Skewed or outlier-prone data Quick, rough estimate
Biostatistics use Reference ranges, clinical cutoffs Quality control checks

Common Mistakes

✕ Forgetting to Sort
Percentiles require data in ascending order. Computing quartiles on unsorted data gives wrong answers.
✕ Misinterpreting the Locator
When the locator \(L\) is a whole number, you must average the values at positions \(L\) and \(L+1\). A common error is to just take the value at position \(L\).
✕ Confusing Percentile with Percent
"Scoring at the 90th percentile" does not mean scoring 90%. It means beating 90% of scores.

Question 1 of 5

A dataset has \(Q_1 = 20\) and \(Q_3 = 50\). What is the \(\text{IQR}\)?

Question 2 of 5

For the sorted dataset 3, 5, 7, 8, 12, 14, 18, 20, what is \(Q_1\)?

Question 3 of 5

A patient's cholesterol level is at the 40th percentile. What does this mean?

Question 4 of 5

Given \(Q_1 = 40\), \(Q_3 = 60\), and \(\text{IQR} = 20\), what is the upper fence for outlier detection?

Question 5 of 5

Which measure of spread is most resistant to outliers?