Definition of a Quartile
Suppose you have a set of observations, and you want to find the quartiles. You might think that since quartiles and quarters share the same root word (quart, meaning one fourth) that the quartile is just one quarter of your data. Not quite, but close!
A quartile is a division of observations into four defined intervals based on the values of the observations and how they compare to the rest of the set of observations.
That sounds a lot more complicated than it is. To put it simply, the quartiles mark off \(25\%\) of the data, and so the quartiles are often named for the percentages:
the first quartile, \(Q_1\), is the \(25^{\text{th}}\) percentile;
the second quartile, \(Q_2\), is the \(50^{\text{th}}\) percentile; and
the third quartile, \(Q_3\), is the \(75^{\text{th}}\) percentile.
The second quartile is always the median of your data set.
If you have an odd number of observations in your data set, exclude the median when finding the quartiles!
Let's look at a quick example.
Suppose you have the data set \(\{43, 52, 68, 79, 94, 100, 113\}\). Find the first, second, and third quartile.
Solution:
The observations in the data set are already ordered, which is handy! There are \(n=7\) observations, which is an odd number, so you will need to exclude the median of the set when calculating the quartiles. In this case the median is \(79\), so that is what you would exclude.
The lower half of the data set would be \(\{43, 52, 68\}\), and the median of that data set is \(52\), so the first quartile is \(Q_1 = 52\).
The second quartile is the median (which is the point you excluded since there are an odd number of data points), so the second quartile is \(Q_2 = 79\).
The upper half of the data set would be \(\{94, 100, 113\}\), and the median of that data set is \(100\), so the third quartile is \(Q_3 = 100\).
Let's look at some more examples of how graphs, medians, and quartiles are related.
Median and Quartiles
If you have a normal distribution the mean and the median are the same. Since the graph of the normal distribution is symmetric, the second quartile is in the center of the graph. Normal distributions also have the properties that for the mean \(\mu\) and standard deviation \(\sigma\):
You might wonder how someone came up with that formula. Remember for the standard normal distribution, has \(\mu=0\) and \(\sigma = 1\). In addition, the \(z\)-score that gives you \(25\%\) of the area under the curve between \(0\) and \(z\) is \(z=0.675\). So all the above formulas do is shift the standard normal distribution information to a normal distribution that has a different mean and standard deviation.
Fig. 1 - Quartiles for a normal distribution graph.
If you are looking at a box plot it is relatively easy to see where the quartiles are by looking at the plot. A box plot is designed to show you exactly where the quartiles are.
Fig. 2 - Box plot with the upper and lower quartiles marked along with the median.
What if you have skew data? In the graph below the data is skewed left. You can still mark the quartiles, and they will correspond to the median of the data, not the mean.
Fig 3. - Skew data showing the quartiles.
Types of Quartile
There are two main types of quartiles, the upper quartile, and the lower quartile. Both of them depend on having an ordered set of \(n\) observations.
The upper quartile is the median of the upper half of the data set.
The lower quartile is the median of the lower half of the data set.
If \(n\) is odd, the median of the entire data set is excluded when calculating the upper and lower quartiles.
Remember that the median is more resistant to outliers or skew in your data. That is why the upper and lower quartiles use the median and not the mean in their calculations.
Let's look at a quick example.
Suppose you have the data set as in the previous example, \(\{43, 52, 68, 79, 94, 100, 113\}\). Find the upper and lower quartiles.
Solution:
The lower half of the data set would be \(\{43, 52, 68 \}\), and the median is \(52\), so the lower quartile would be \(52\). Notice that this is the same as the \(Q_1\).
The upper half of the data set would be \(\{94, 100, 113\}\), and the median is 100, so the upper quartile is \(100\), which is the same as \(Q_3\).
Will it always be the case that the upper quartile is the same as \(Q_3\) and the lower quartile is the same as \(Q_1\)? Yes, because that is the way they are defined! Just be sure let's look at another example.
Take the data set \(\{6, 8, 15, 36, 40, 41, 41, 43, 43, 48\}\). Find \(Q_1\), \(Q_2\), and \(Q_3\), along with the upper and lower quartiles.
Solution:
For this data set there are an even number of points, so none will need to be set aside when finding the quartiles. The points are already ordered, and the median of the set is
\[\text{median} = \frac{40+41}{2} = 40.5 = Q_2.\]
The lower half of the data set is \(\{6, 8, 15, 36, 40\}\), and the median of that set is \(15\). So
\[\text{lower quartile} = 15 = Q_1.\]
The upper half of the data set is \(\{41, 41, 43, 43, 48\}\), and the median of that set is \(43\). So
\[\text{upper quartile} = 43 = Q_3.\]
Quartile Range
The range of your data set is relatively simple to find.
The range of the data set is the highest value minus the lowest value.
The interquartile range is another term you might come across.
The interquartile range, often abbreviated IQR, is the difference between the upper and lower quartiles.
IQR = upper quartile - lower quartile.
Remember that the standard deviation is a measure of how spread out the data in a set is; in other words, it measures how far the observations tend to fall from the center of the data set (the mean).
The interquartile range is also a measure of how spread out the data in a set is by looking at the middle half of the data:
if the interquartile range is small, the middle half of the data is tightly clustered, indicating low variability; but
if the interquartile range is large, the middle half of the data is more spread out, indicating higher variability.
By looking at the middle half of the data, the interquartile range avoids being influenced by outliers or extreme values.
You might also see a reference to the semi-interquartile range.
The semi-interquartile range is half of the interquartile range.
Let's take a look at an example of finding these items for a data set.
Let's go back to the data set \(\{43, 52, 68, 79, 94, 100, 113\}\). You already know that \(Q_1 = 52\), \(Q_2 = 79\), and \(Q_3 = 100\). Find the range, the interquartile range, and the semi-interquartile range.
Solution:
The range is the highest value in the set minus the lowest value in the set, so
\[\text{range} = 113-43 = 70.\]
The interquartile range is
\[\begin{align}\text{IQR} &= Q_3 - Q_1 \\ &= 100-52\\ &=48. \end{align}\]
The semi-interquartile range is half of the IQR, so
\[\text{semi-interquartile range} = \frac{48}{2}=24.\]
More examples are always good!
Quartile Examples
Let's take a look at some more examples involving quartiles.
Suppose your data set is \(\{0,0,0,0,0,0,0,0,0,0,1,1,1,3, 17, 300\}\). Find the first, second, and third quartiles, along with the range and interquartile range.
Solution:
This data set is a bit unusual since \(0\) is repeated \(10\) times in it! The range is the largest value minus the largest value, so
\[\text{range} = 100 - 0 = 100.\]
There are \(16\) observations in the data set, and the median is \(0\). So \(Q_2 = 0\). In fact, the lower half of the data set is all zeros, so \(Q_1=0\) as well.
For the upper half of the data set you have \(\{0,0,1,1,1,3, 17, 300\}\), and the median of that set is \(1\), so \(Q_3=1\). Finding the IQR gives you
\[\text{IQR} = Q_3-Q_1 = 1-0=1.\]
The low value for IQR indicates that the middle half of the data doesn't have much variability. You can list the quartiles of the data:
- lowest \(25\%\) of observations: \(\{0,0,0,0\}\);
- highest \(25\%\) of observations: \(\{1, 3, 17, 300\}\); and
- middle \(50\%\) of observations: \(\{0, 0, 0, 0,0,0, 1, 1\}\).
As you can see the middle \(50\%\) of the observations are clustered around zero, which is why the IQR is so small. It isn't affected by the extreme values in the highest \(25\%\) of the observations.
The next example demonstrates how you can use box plots to determine the quartiles and calculate the interquartile and semi-interquartile ranges.
The box plot below shows the distribution of ages of pets in a doggie daycare where age is measured in years. Using the information presented on the box plot, calculate the interquartile range as well as the semi-interquartile range.
Fig. 4 - Box plot of pets in a doggie daycare.
Solution:
First, you need to find the values of \(Q_1\) and \(Q_3\). This can be done by reading them off the box plot:
- \(Q_1 = 5.5\); and
- \(Q_3 = 10\).
Next, calculate the interquartile range using the formula:
\[ \begin{align} IQR & = Q_3 - Q_1 \\ &= 10-5.5 \\ &= 4.5. \end{align}\]
Finally, calculate the semi-interquartile range:
\[ \begin{align} \text{semi-interquartile range} &= \frac{IQR}{2} \\&= \frac{4.5}{2} \\&= 2.25.\end{align}\]
The units on each of the answers are years.
Quartiles - Key takeaways
- Each quartile represents \(25\%\) of the values of a set of ordered data.
- The lower quartile is denoted by \(Q_1\) and the upper quartile is denoted by \(Q_3\). The second quartile is denoted by \(Q_2\).
- To calculate \(Q_2\), calculate the median of the data set.
- The upper and lower quartiles are calculated by determining the medians of the upper and lower halves of the data set respectively. If there is an odd number of values in the data set, then the median is excluded when calculating the upper and lower quartiles.
- The interquartile range is equal to \(Q_3 - Q_1\) and the semi-interquartile range is equal to half the interquartile range.
How we ensure our content is accurate and trustworthy?
At StudySmarter, we have created a learning platform that serves millions of students. Meet
the people who work hard to deliver fact based content as well as making sure it is verified.
Content Creation Process:
Lily Hulatt is a Digital Content Specialist with over three years of experience in content strategy and curriculum design. She gained her PhD in English Literature from Durham University in 2022, taught in Durham University’s English Studies Department, and has contributed to a number of publications. Lily specialises in English Literature, English Language, History, and Philosophy.
Get to know Lily
Content Quality Monitored by:
Gabriel Freitas is an AI Engineer with a solid experience in software development, machine learning algorithms, and generative AI, including large language models’ (LLMs) applications. Graduated in Electrical Engineering at the University of São Paulo, he is currently pursuing an MSc in Computer Engineering at the University of Campinas, specializing in machine learning topics. Gabriel has a strong background in software engineering and has worked on projects involving computer vision, embedded AI, and LLM applications.
Get to know Gabriel