Читать книгу Medical Statistics - David Machin - Страница 71

Calculating the Quartiles and Inter Quartile Range

Оглавление

Arrange the n observations in increasing or decreasing order. Split the data set into four equal parts –or quartiles using three cut‐points:

1 Lower quartile (25th centile) or the ¼(n + 1)th ordered value;

2 Median(50th centile) or the ½ (n + 1)th ordered value;

3 Upper quartile(75th centile) or the ¾(n + 1)th ordered value.

The interquartile range (IQR) is the upper quartile minus the lower quartile.

It should be noted there is not a single standard convention for calculating the quartiles. When the quartile lies between two observations the simplest option is to take the mean of the two observations. A second option is for the lower and upper quartiles to be the ¼(n + 1)th and ¾(n + 1)th ordered values respectively. A third option is for the lower and upper quartiles to be the ¼n+½ and ¾n+ ½ ordered values respectively. It is also common to round the ¼ and ¾ to the nearest integer and only use interpolation when this involves calculation of the midpoint of two values. Differences between the results using the different conventions are usually small and unimportant in practice.

To calculate the quartiles for the foot corn size data in Tables 2.4 and 2.5, as the number of observations is even (n = 16), the upper quartile is the ¾(n + 1)th ordered value or ¾ (17)th = 12¾ ordered value. When the quartile lies between two observations the easiest option is to take the mean (there are more complicated methods). The upper quartile (simple method) is the mean of the 12th and 13th ordered values or (4 + 5)/2 = 4.5 mm. Rounding the 12¾ ordered value to the nearest integer (the 13th ordered value) gives an upper quartile of 5 mm.

A more complicated method for estimating the upper quartile is by interpolation between the 12th and 13th ordered values. The interpolation involves moving ¾ of the way from the 12th ordered value towards the 13th value, i.e. 4 + ¾ (4 to 5) = 4.75 mm (or 4.8 mm when rounding to one decimal place).

The lower quartile is the ¼(n + 1)th ordered value or ¼(17)th = 4¼ ordered value. The lower quartile (simple method) is the mean of the 4th and 5th ordered values or (2 + 2)/2 = 2.0 mm. Rounding the 4¼ ordered value to the nearest integer (the 4th ordered value) gives a lower quartile of 2 mm. A more complicated method for estimating the lower quartile is by interpolation between the fourth and fifth ordered values. The interpolation involves moving ¼ of the way from the fourth ordered value towards the fifth value, i.e. 2 + ¼ (2 to 2) = 2 mm (or 2.0 mm when rounding to 1 decimal place). The IQR estimated by the simple method is 2.0 to 4.5 mm vs 2.0 to 5.0 mm (using the rounding to the nearest integer method) vs 2.0 to 4.8 mm using the more complex interpolation method. As we already mentioned the differences between the results using the different conventions for calculating the quartiles are usually small and unimportant in practice.

Medical Statistics

Подняться наверх