In: Statistics and Probability
There are three quartiles for a data - First or lower quartile, Second quartile or median, Third or lower quartile. Quartiles divide the ordered data into 4 quarters. Below examples illustrates the quartile calculation for odd and even number of observations.
Example 1:
Let the ordered data be 1, 1, 3, 4, 5, 5, 5, 8.
Here there are even number of observations.
The median or the second quartile = = 4.5
Divide the data into two equal halves i.e 1, 1, 3, 4 and 5, 5, 5, 8
Median of lower half = First or lower quartile = = 2
Median of upper half = Third or upper quartile = = 5
Example 2:
Let the ordered data be 1, 1, 3, 4, 5, 5, 8.
Here there are an odd number of observations.
The median or the second quartile = 4
Divide the data into two equal halves by excluding the median i.e 1, 1, 3 and 5, 5, 8
Median of lower half = First or lower quartile = 1
Median of upper half = Third or upper quartile = 5
Note:
Median for an odd number of observations is the middle observation in the ordered data.
Median for an even number of observations is the average of the two middle observations in the ordered data.