# Suppose we have data set: $19, 21, 22, 22, 28, 31, 33, 44, 50$. Find the interquartile range of this set.

Suppose we have data set: $19, 21, 22, 22, 28, 31, 33, 44, 50$. Find the interquartile range of this set.

First solution: Firstly, we should find the $75$th percentile of this set. $0,75\cdot 9=6,75$ and rounding up this number to nearest whole we get $7$. So the $75$th percentile of this set is $33$. Secondly, should find the $25$th percentile of this set. $0,25\cdot 9=2,25$ and rounding up this number to nearest whole we get $3$. So the $25$th percentile of this set is $22$. Hence, $$\text{interquartile range} = Q_3-Q_1=33-22=11.$$

Second solution: The median of this set is $28$. First quartile is the median of lower set. Hence $Q_1=\dfrac{21+22}{2}=21.5$, third quartile is the median of upper set. Hence $Q_3=\dfrac{33+44}{2}=38.5$. $$\text{interquartile range} = Q_3-Q_1=38.5-21.5=17.$$

Which one is correct? Please explain why one of the solutions is false.

• I think the second solution is true.
– GAVD
Sep 6, 2017 at 9:41

The first solution is "correct".

In the second one, if you keep the median in your lower set and the upper set also, then you will get the same answer as the first solution.

The reason I put "correct" in quotes is that this is matter of defining what the terms sample-median and sample-first-quartile and sample-third-quartile mean. What you obtain from this exercise is an estimate of the interquartile range of the distribution, not the interquartile range.

If you were talking about the interquartile range of the probability distribution (say as continuous function), this issue would not arise.

Both methods are correct with the exception that in finding the quartile positions you should use $\frac14(n+1)$ and $\frac34(n+1)$. The same applies to the median position: $\frac12(n+1)$.

There are $9$ items. The median (middle or second quartile) position is: $$\frac{2}{4}(9+1)=5.$$ The fifth number in the ascending (or descending) ordered items is $x_5=28$.

Similarly, the lower (first quartile) position is: $$\frac{1}{4}(9+1)=2.5.$$ The $2.5th$ number in the ascending (if descending it is upper quartile) ordered items is: $$x_{2.5}=x_2+0.5(x_3-x_2)=21+0.5(22-21)=21.5.$$

• Why are you using $\frac{1}{4}(n+1)$ and $\frac{3}{4}(n+1)$? Could you clarify this moment please?
– RFZ
Sep 6, 2017 at 11:06
• $0.75\cdot 9=6.75$ should be $0.75\cdot 10=7.5$. Sep 6, 2017 at 12:09