How to calculate quartiles in statistics? The guide with the definition, the right method to calculate them and a practical example.
Quartiles are those values that are found in positions such as to divide any distribution (whether continuous or discrete) into four equal parts .
The first quartile (corresponding to the value 0.25 ) is called the lower quartile , the second (corresponding to the value 0.5 ) is the median that divides the distribution in half , finally the third (corresponding to the value 0.75 ) is called the upper quartile .
Quartiles are therefore position indices that give an idea of the order of magnitude with which a quantitative variable manifests itself in a sample or population. In the next steps, we will illustrate how to calculate these values.
Calculate the difference between the upper quartile and the lower quartile
The difference between the upper quartile and the lower quartile determines the interquartile range , which is one of the indices of the distribution . In this guide we will see the methodology for calculating the quartiles .
In descriptive statistics , in the presence of a distribution of a qualitative character that can be ordered (that is, when we are faced with modalities that can be ordered according to a specific criterion) or, in the more frequent case, quantitative, the quartiles are those values/modalities that divide the population into four parts of the same number.
Calculate frequencies
To calculate the quartiles, we proceed as follows: given a distribution of values, we order it in ascending order (from the smallest to the largest), after which we calculate the frequencies (first the absolute ones, then the cumulative ones). At this point we will know how the values in question are distributed. Therefore, the value that corresponds to the cumulative frequency greater than or equal to 0.25 is the first quartile, the one corresponding to a value greater than or equal to 0.5 is the median (the second quartile), and the one corresponding to a value greater than or equal to 0.75 is the third quartile.
Calculate quartiles
We now propose an example for the calculation of quartiles. Given the following distribution of 10 units, 63, 95, 32, 57, 43, 12, 44, 72, 41, 69, they must be ordered in ascending order: 12, 32, 41, 43, 44, 57, 63, 69, 72, 95.
The quartile of order 0.25 will correspond to 41, that of order 0.5 to 44 and that of order 0.75 to 69. We now proceed by illustrating the calculations.
The median (the quartile of order 0.5) is calculated by averaging the terms corresponding to (number/2) and (number/2+1), since the terms are even, therefore n=10. 10/2=5. 10/2+1=6.
We must now look at the values that occupy the fifth and sixth positions (44 and 57) and calculate the average between these: (44+57)/2=50.5. 50.5 will therefore be the median of the distribution.
To calculate the other two quartiles, proceed as follows: the value of the first quartile will be included among the values lower than the median, therefore between 12, 32, 41, 43, 44. Now calculate the median of these values (note that now the number is odd, therefore n=5): (n+1)/2, or (5+1)/2=3. The first quartile will be the term that occupies third place, or 41.
The same procedure should be followed to calculate the third quartile, but looking at the values after the median, therefore the value of the third quartile is equal to 69.




