Enter a set of numbers separated by commas to calculate the quartiles and interquartile range.
How to Calculate Quartiles and Interquartile Range
Quartiles and the Interquartile Range (IQR) are important measures in descriptive statistics that help us understand the spread and central tendency of a dataset. They are particularly useful for identifying outliers and comparing distributions.
Formulas and Their Meanings
For an ordered dataset of n values:
Q1 (First Quartile): The median of the lower half of the data
Q2 (Median):
\[Q2 = \begin{cases}
\frac{x_{(n+1)/2}}{2}, & \text{if n is odd} \\
\frac{x_{n/2} + x_{(n/2)+1}}{2}, & \text{if n is even}
\end{cases}\]
Q3 (Third Quartile): The median of the upper half of the data
IQR (Interquartile Range): \(IQR = Q3 - Q1\)
Where xi represents the i-th value in the ordered dataset.
Calculation Steps
Sort the dataset in ascending order.
Find the median (Q2) of the entire dataset.
Find Q1 by calculating the median of the lower half of the data (values below the median).
Find Q3 by calculating the median of the upper half of the data (values above the median).
Calculate the IQR by subtracting Q1 from Q3.
Example
Let's calculate the quartiles and IQR for the dataset: 2, 4, 7, 9, 12, 15, 18
The data is already sorted.
Q2 (Median) = 9 (middle value)
Q1 = median of (2, 4, 7) = 4
Q3 = median of (12, 15, 18) = 15
IQR = Q3 - Q1 = 15 - 4 = 11
Visual Representation
This box plot illustrates the quartiles and range of our example dataset. The box represents the IQR, with Q1, median, and Q3 marked. The whiskers extend to the minimum and maximum values.