
In the realm of statistics, summarizing data is essential for gaining insights and making informed decisions. One powerful technique for summarizing numerical data is the Five Number Summary. Whether you’re a data scientist, a business analyst, or a student learning statistics, understanding this summary is crucial.
The Five-Number Summary is a powerful descriptive statistics technique that offers a snapshot of a dataset’s distribution. By dividing an ordered dataset into four equal parts (quartiles), it allows you to instantly gauge the data’s central tendency, overall spread, and inherent skewness.
Instead of staring at thousands of raw rows, this summary condenses your data into five essential milestones:
- 1. Minimum: The absolute lowest value in the dataset.
- 2. First Quartile ($Q_1$): The 25th percentile. Exactly 25% of the data points fall below this value.
- 3. Median ($Q_2$): The exact middle value of the dataset, dividing it cleanly into a lower 50% and an upper 50%.
- 4. Third Quartile ($Q_3$): The 75th percentile. Exactly 75% of the data points fall below this value.
- 5. Maximum: The absolute highest value in the dataset.
At-a-Glance: Five-Number Summary, IQR Outlier Detection, & Code Metrics
| Metric / Concept | Statistical Definition | Mathematical Formula | Python Code (NumPy) | Example 1 Output (a) |
| Minimum | The absolute lowest data point. | $\text{Min}$ | np.min(a) | -38.0 |
| First Quartile ($Q_1$) | The 25th percentile (cuts off lower 25% of data). | $Q_1 = \text{P}_{25}$ | np.percentile(a, 25) | 12.0 |
| Median ($Q_2$) | The exact midpoint of the dataset (50th percentile). | $Q_2 = \text{P}_{50}$ | np.percentile(a, 50) | 61.0 |
| Third Quartile ($Q_3$) | The 75th percentile (cuts off lower 75% of data). | $Q_3 = \text{P}_{75}$ | np.percentile(a, 75) | 89.0 |
| Maximum | The absolute highest data point. | $\text{Max}$ | np.max(a) | 1200.0 |
| Interquartile Range (IQR) | The spread of the middle 50% of the data. | $\text{IQR} = Q_3 – Q_1$ | q3 - q1 | 77.0 (Calculated as $89 – 12$) |
| Lower Fence | The threshold below which points are outliers. | $Q_1 – (1.5 \times \text{IQR})$ | q1 - (1.5 * IQR) | -103.5 |
| Upper Fence | The threshold above which points are outliers. | $Q_3 + (1.5 \times \text{IQR})$ | q3 + (1.5 * IQR) | 204.5 |
| Identified Outliers | Data points falling completely outside the fences. | $x < \text{Lower}$ OR $x > \text{Upper}$ | Checked via Boxplot / Filters |
Visual Representation:
To better comprehend the Five Number Summary, let’s visualize it using a boxplot, also known as a box-and-whisker plot. In a boxplot, the median is represented by a vertical line inside a box, which extends from the first quartile (Q1) to the third quartile (Q3). The whiskers extend from the minimum to the maximum value, encompassing the bulk of the data.
Significance and Interpretation:
The Five Number Summary offers several advantages:
- Concise Description: Instead of analyzing every single data point, the Five Number Summary provides a succinct overview of the dataset’s distribution, allowing for quick interpretation.
- Robustness: Unlike measures such as the mean and standard deviation, which can be heavily influenced by outliers, the Five Number Summary is resistant to extreme values, making it robust for skewed or non-normally distributed data.
- Comparison: It facilitates easy comparison between different datasets, enabling analysts to assess similarities, differences, and patterns.
- Identifying Outliers: By examining the minimum and maximum values, analysts can identify potential outliers that may require further investigation.
Detecting Outliers Using the Five-Number Summary
An outlier is any data point that deviates so significantly from the rest of the dataset that it raises suspicion. Left unchecked, outliers can warp data distributions, skew averages, and compromise the integrity of your statistical models.
The Five-Number Summary serves as the perfect first line of defense against these anomalies. By comparing the extreme values (Minimum and Maximum) against the bulk of the data, you can instantly flag data points that fall far outside the expected range.
The Mathematical Threshold: The $1.5 \times \text{IQR}$ Rule
To objectively prove a data point is an outlier, analysts calculate the Interquartile Range (IQR)—the distance between the third and first quartiles:
$$\text{IQR} = Q_3 – Q_1$$
Using the IQR, you can establish upper and lower boundaries. Any value falling outside these “fences” is classified as an outlier:
- Lower Bound: $Q_1 – 1.5 \times \text{IQR}$ (Any point below this is an outlier)
- Upper Bound: $Q_3 + 1.5 \times \text{IQR}$ (Any point above this is an outlier)
Where Do Outliers Come From?
When you spot an outlier using this method, it typically points to one of three things:
- Measurement Errors: Faulty equipment, typos, or data entry bugs.
- Sampling Variability: Unlucky or unusual data extraction that isn’t representative of the whole.
- Genuine Anomalies: Real, accurate data points that represent rare occurrences (e.g., a massive spike in e-commerce traffic on Black Friday).
Properly identifying and handling these anomalies ensures your statistical analysis remains reliable, predictable, and accurate.
Example Application:
1) suppose we have a random number dataset like this :
a=[10,12,10,9,24,56,43,12,89,89,190,87,-38,89,94,66,98,128,42,44,87,4,1000,1200]
Now,
we have to find out q1 which is 25 percentile of the data
q1=np.percentile(a,25)
print(q1)
// ouput is 12.0
we have to find out q3 which is 75 percentile of the data
q3=np.percentile(a,75)
print(q3)
// output is 89
and q2
q2=np.percentile(a,50)
print(q2)
// Output is 61.0
Now , we have to find out IQR:
IQR=(Q3-Q1)
IQR=(q3-q1)
print(IQR)
//Output is 78.25
Now we have to find out lower fence and higher fence which is 1.5 times q1 and 1.5 times q3
lower_fence=q1-(1.5*IQR)
higher_fence=q3+(1.5*IQR)
print(lower_fence,higher_fence)
//Output is -105.375 , 207.625
From here we can tell that the numbers which are not range between [-105.375 , 207.625] are outliers
so here we have outliers as we have 2 numbers which are out of range.
Let’s do a boxplot
From here it clearly visible outliers. which are placed above on higher fence.
2) Suppose we have a dataset representing the salaries of employees in a company. Using the Five Number Summary, we can quickly grasp essential insights:
import numpy as np
import seaborn as sns
np.random.seed(42)
salary = np.random.randint(10000, 10000000, size=1200)
sns.boxplot(salary)
From this summary, we can infer the salary distribution, assess the median income, and identify any outliers.

The Five Number Summary is a valuable tool in statistical analysis, providing a concise yet informative summary of numerical data. Its simplicity, robustness, and interpretability make it widely used across various fields, from finance and economics to healthcare and education. By understanding and utilizing the Five Number Summary, analysts can unlock valuable insights, make informed decisions, and communicate findings effectively.
Freqently Ask Question:
Why is the Five-Number Summary preferred over the Mean and Standard Deviation?
The Advantage: Robustness. The mean (average) and standard deviation are highly sensitive to extreme values. A single massive outlier can completely skew them.
Why it matters: Because the Five-Number Summary relies on percentiles and the median, it resists being warped by anomalies, making it a far more accurate representation of skewed or non-normally distributed data.
What is the difference between a Quartile and a Percentile?
Quartiles: Divide an ordered dataset into four equal quarters (each representing 25% of the data).
Percentiles: Divide a dataset into 100 equal parts.
The Connection: They are two sides of the same coin: $Q_1$ is exactly the 25th percentile, $Q_2$ (the median) is the 50th percentile, and $Q_3$ is the 75th percentile.
Can the Minimum or Maximum value of a dataset also be an outlier?
Yes, absolutely. In fact, when using the Five-Number Summary, the minimum and maximum values are your primary indicators of outliers.
How it works: If your calculated mathematical fences show that outliers exist, those outliers will always be the extreme minimums or maximums of your dataset.
Why do we use exactly $1.5$ for the Interquartile Range (IQR) outlier rule?
The Origin: This threshold was established by statistician John Tukey, the inventor of the boxplot.
The Logic: In a perfectly normal, bell-curve distribution, $1.5 \times \text{IQR}$ encompasses approximately 99.3% of the data. Setting the fence here ensures that you only flag truly unusual anomalies (the remaining 0.7%) rather than normal variations in your data.
How does a Boxplot show the direction of data skewness?
By looking at the box and whiskers: * Right/Positive Skew: The median line sits closer to the bottom ($Q_1$), and the top whisker (towards the maximum) is significantly longer.
Left/Negative Skew: The median line sits closer to the top ($Q_3$), and the bottom whisker (towards the minimum) is stretched out.
Symmetric Data: The median line rests directly in the middle of the box, with whiskers of equal length on both sides.