Fundamentals of Statistics contains material of various lectures and courses of H. Lohninger on statistics, data analysis and chemometrics......click here for more.


Quartile

Quartiles partition - as the name suggests - the corresponding distribution into four quarters each containing 25% of the data. A particular quartile is therefore the border between two neighboring quarters of the distribution.

The calculation of the quartiles is sometimes not quite clear (especially if the number of observations of a sample is not divisible by four). We therefore provide exact instructions how to calculate the quartiles. Assuming a sample of N observations the quartiles are defined as follows ("round" stands for the rounding to the nearest integer):

  • 1. quartile: the value of the sorted series of observations having the position x = round(0.25*(N+1))
  • 2. quartile (median): if N is even, Q2 is the average of the two values at the positions N/2 and N/2+1; if N is odd, Q2 is the value at the position (N+1)/2
  • 3. quartile: the value of the sorted series having the position x = round(0.75*(N+1))

Example: Assume that we have obtained the following 20 observations:
   2, 4, 7, -20, 22, -1, 0, -1, 7, 15,
   8, 4, -4, 11, 11, 12, 3, 12, 18, 1
In order to calculate the quartiles we first have to sort the observations:
   -20, -4, -1, -1, 0, 1, 2, 3, 4, 4,
   7, 7, 8, 11, 11, 12, 12, 15, 18, 22
The position of the first quartile is x = round(0.25*(20+1)) = round(5.25) = 5, which means that Q1 is the 5th value of the sorted series, namely Q1 = 0. The other quartiles are calculated in the same way resulting in Q2 = 5.5 and Q3 = 12.

Remark on practical aspects: quartiles are usually calculated only for samples with more than 12 observations (a minimum of 20 observations would be even better).