What is statistics? – Interquartile Range

What is InterQuartile Range: Definition
The value of the InterQuartile Range (IQR: Q1 – Q3) is the result that we will get when the value that exists in the First Quartile position will be subtracted from the value that exists in the Third Quartile position. The InterQuartile Range (IQR) is also known as midspread or middle fifty. It shows the statistical dispersion in an Arithmetic set. It also used for the construction of the Boxplot – a Statistical Graph figure.

InterQuartile Range: Statistical Formula
The Statistical formula for the InterQuartile Range (IQR) is the following one:

IQR=Q_{3}-Q_{1}

interquartile_range_general_01

Calculating the InterQuartile Range
There are two main methods for finding the value of the InterQuartile Range which is based either on Median (Method A) or based on a Statistical Formula (Method B). Each method may produce different results. Therefore, you must refer what method you used in order to find the value of IQR.

interquartile_range_both_methods

Method A: The Median of the Median: Even Cases
This method is entirely based on the Median. Note that Median is always found in Q2 position. Also, every Median and Q2 position splits any given Arithmetic set in half. The value of the InterQuartile Range can be found, if the next steps are followed:

i) We must find the Median value for a given Arithmetic set.
—–If the Arithmetic set includes an Even number of values e.g. 10, 12, 100, then we must calculate the Arithmetic Mean (average) of the two middle values.
—–If the Arithmetic set includes an Odd number of values e.g. 9, 11, 101, then the middle number can be identified as the Median of this set.

interquartile_range_two_sets

ii) Due to Median’s position or Q2 position, two new Arithmetic Subsets will virtually be produced that each will be equal to the number of values that will include. That is, the 50% of the values of the Main Arithmetic set will be Left from the Median and the 50% of the values will be Right from the Median.

Based on this method, Median is Always not included in these two new Arithmetic subsets.

iii) Then, we must find the Median value in these two new Arithmetic subsets, too.
—–If the Main Arithmetic set had an Even number of values, then these two Arithmetic subsets will contain an Odd number of values. Therefore, the middle number can be identified as the Median of this set.
—–If the Main Arithmetic set had an Odd number of values, then these two Arithmetic subsets will contain an Even number of values. Therefore, we must calculate the Arithmetic Mean (average) of the two middle values for each Arithmetic subset. These two new values will be the Median for each Arithmetic subset.

iv) These two new values corresponds to the values that exist in the 1st Quartile position and in the 3rd Quartile position in the Main Arithmetic set.

v) Then, in order to find the value of the InterQuartile Range, we must subtract the value that exists in Q1 position from the value that exists in the Q3 position.

Method A: The Median of the Median: Even Cases: Example
Here, an example is given (n=10) for Even cases. The dataset that we will use in this example is the following one. It has been already arranged in an ascending order (a prerequisite for finding the Median value / Quartile positions):

5, 7, 10, 10, 11, 13, 13,  15,  15,  18.

interquartile_range_Median_method

i) Because, here, we have a dataset with Even number of values, two middle numbers exists which are: 11 and 13.

ii) Therefore, the Median value is found by calculating the Arithmetic mean (average) of these two values, which is 12: \frac{11+13}{2}=\frac{24}{2}=12.

interquatile_median_2

iii) Every Median splits a dataset into half in such way that 50% of the values will be left of the Median and the other 50% of values will be right of the Median. Therefore:

iv) we have 5 values left of “12” (Median) and other 5 values right of “12” (Median). Therefore, we have:

Left of “12” (Median): 5, 7, 10, 10, 11
Right of “12” (Median): 13, 13,  15,  15,  18.

interquartile_range_splitting_median_Q2

v) In The next step, we must find the Median for each Arithmetic subset which will be the same number as the Middle value of each Arithmetic subset – because each subset of this example contains an Odd number of values. Therefore:

–i) in the Left Arithmetic subset, the middle value is 10, that is, the Median equals 10 (Q1 position)
–ii) in the Right Arithmetic subset, the middle value is 15, that is, the Median equals 15 (Q3 position)

vi) The Median value in each Arithmetic subset corresponds to the value that exists in Q1 and Q3 positions, respectively. Then, the InterQuartile Range can be referred as “10-15″. Therefore, the value of InterQuartile Range can be found by subtracting the value that exists in Q1 position from the value that exists in Q3 position, which equals 5:

Q_{1}=10, Q_{3}=15 =>15-10=5, and thus: IQR=5.

interquartile_range_IQR_01

Method A: The Median of the Median: Odd Cases: Example
Let’s say we have the following dataset that includes nine (n=9) numbers in an ascending order (a prerequisite for finding the Median value / Quartile positions):

5, 7, 10, 10, 11, 13, 13,  15,  15

i) Because we have a dataset that includes Odd number of values, Median is equals to the value of the middle number of this set which is 11.

interquartile_range_Median_method_Odd_Case

ii) Every Median splits a dataset into two subsets: 50% of the values will be left of the Median and the other 50% of values will be right of the Median.

iii) Then, we have 4 values left of “11” (Median) and other 4 values right of “11” (Median). Therefore, we have:

Left of “11” (Median): 5, 7, 10, 10
Right of “11” (Median): 13, 13,  15,  15

interquartile_range_splitting_median_Q2_Odd_cases

iv) In the next step, we must find the Median for each Arithmetic subset which will be the Arithmetic Mean (average) of the two middle numbers in each Arithmetic subset – because each subset of this example contains an Even number of values.

v) Therefore, the Median for these two Arithmetic subsets is 8.5 (Q1 position) and 14 (Q3 position), respectively:

–Left Arithemtic subset: Middle values: 7 and 10. Therefore: \frac{(10+7)}{2}=\frac{17}{2}=8.5
–Right Arithemtic subset: Middle values: 13 and 15. Therefore: \frac{(13+15)}{2}=\frac{28}{2}=14

interquatile_median_Odd_cases_result

vi) The Median value in each Arithmetic subset corresponds to the value that exists in Q1 and Q3 positions, respectively. Then, the InterQuartile Range can be referred as “8.5-14″.

vii) Therefore, the value of InterQuartile Range can be found by subtracting the value that exists in Q1 position from the value that exists in Q3 position, which equals 5.5:

Therefore, the value of InterQuartile Range, in that case, is: 14-8.5=5.5

interquartile_range_general_Odd_cases_IQR

Method B: The Statistical Formula
The following formula do not care if the Arithmetic dataset has an Odd or Even number of values. However, the Statistical Formula will be used for both Arithmetic series ((n=10) and (n=9)) in order to be able to compare the results of both methods. Note that the Statistical Formula is only depended on the number of values that exist in a given dataset. The following datasets have been arranged in an ascending order (a prerequisite for finding Quartile positions):

The (1st) Arithmetic set with an Even number of values (n=10)
5, 7, 10, 10, 11, 13, 13,  15,  15,  18.

The (2nd) Arithmetic set with an Odd number of values (n=9)
5, 7, 10, 10, 11, 13, 13,  15,  15

interquartile_range_two_sets_1st_2nd

i) The first step is to find what is the exact position of the Q_{1} and the Q_{3} in each Arithmetic set. In order to find these positions, we must apply the relevant Statistical formula in each case:

t=(\frac{k}{i_{m}})(n+1)

interquartile_range_Formula_mine

Explanation
The t is the exact position that Q_{1} and Q_{3} have on a given dataset.
The n is replaced by the total number of values that exist on a given dataset. Here, it is replaced with 9 or 10, respectively.
The k is replaced by the position we are searching to find. Here, it is replaced by 1 (Q1) and 3 (Q3), for each Quartile, respectively, for both datasets.
The i_{m} is replaced by the total number of Arithmetic pieces / moieties that are produced, here, by Quartiles. Quartiles always produce 4 Arithmetic pieces, therefore, it is replaced by 4.

Results for the 1st Arithmetic set (n=10)
Q2 results also will be presented for comparison reasons. For the position t=Q_{1} and t=Q_{3}, we have as a result:

t=Q_{1}=\frac{(1)*(10+1)}{4}=\frac{11}{4}=2.75 and
t=Q_{3}=\frac{(3)*(10+1)}{4}=\frac{33}{4}=8.25

t=Q_{2}=\frac{(2)*(10+1)}{4}=\frac{22}{4}=5.5

ii) The next step is to find what values correspond to these positions in the given Arithmetic set.

Positions of 2.75 and 8.25
The position t=Q_{1}=Q_{2.75} can be found between the 2nd and 3rd values of the Arithmetic set. That is, between the values of 7 and 10.
The position t=Q_{3}=Q_{8.25} can be found between the 8th and 9th values of the Arithmetic set. That is, between the values of 15 and 15.

The position t=Q_{2}=Q_{5.5} can be found between the 5th and 6th values of the Arithmetic set. That is, between the values of 11 and 13.

In order to find what values correspond to these positions in the given Arithmetic set, these steps must be followed:
a) Between these two values, We subtract the lower number from the higher number.
That is: 10-7=3 and 15-15=0
b1) For Q1 position: We multiply the result by 0.75 or \frac{3}{4}, both forms are equivalent.
That is: 3*0.75=2.25
b2) For Q3 position: We multiply the result by 0.25 or \frac{1}{4}, both forms are equivalent.
That is: 0*0.25=0
c) We add the produced result to the Lowest number between the two given values.
That is: 7+2.25=9.25 and 15+0=15

interquartile_range_formula_set1_result

Q1 position and Q3 position (and Q2 position) corresponding values
The position Q_{1}=Q_{2.75} corresponds to the value of 9.25:
Q_{1}=Q_{2.75}=7+(\frac{3}{4})*(10-7)=7+0.75*(3)=7+2.25=9.25

The position Q_{3}=Q_{8.25} corresponds to the value of 15:
Q_{3}=Q_{8.25}=15+(\frac{1}{4})*(15-15)=15+0.25*(0)=15+0=15

The position Q_{2}=Q_{5.5} corresponds to the value of 12:
Q_{2}=Q_{5.5}=11+(\frac{2}{4})*(13-11)=11+0.5*(2)=11+1=12

iii) Therefore, the InterQuartile Range can be described by this interval: “9.25-15″ for the given arithmetic set, while

iv) The value of the InterQuartile Range can be found if we subtract the value that corresponds to Q1 position from the value that corresponds to Q3 position, which is equal to 5.75: IQR=15-9.25=5.75

Results for the 2nd Arithmetic Set (n=9)
For the position t=Q_{1} we have as a result: t=Q_{1}=\frac{(1)*(9+1)}{4}=\frac{10}{4}=2.50, and
For the position t=Q_{3} we have as a result: t=Q_{3}=\frac{(3)*(9+1)}{4}=\frac{30}{4}=7.50

For the position t=Q_{2} we have as a result: t=Q_{2}=\frac{(2)*(9+1)}{4}=\frac{20}{4}=5

The position 2.50 can be found between the 2nd and 3rd values of the Arithmetic set. That is, between the numbers of 7 and 10 while the position 7.50 can be found between the 7th and 8th values of the Arithmetic set, that is, between the numbers of 13 and 15.

Note that the position “5” has no decimals therefore, it corresponds to the 5th Arithmetic member of this set, which is 11.

Positions of 2.50 and 7.50
In order to find what value correspond to these positions in the given Arithmetic set, these steps must be followed:
a) Between these two values, We subtract the lower number from the higher number.
That is: 10-7=3 and 15-13=2
b) We multiply the result by 0.50 or \frac{2}{4} in both cases, both forms are equivalent.
That is: 3*0.50=1.5 and 2*0.50=1
c) We add the produced result to the Lowest number between the two given values.
That is: 7+1.50=8.50 and 13+1=14

interquartile_range_formula_set2_result

Q1 position and Q3 position corresponding values
Therefore, we get as a result 8.50 for Q1 position:
Q_{1}=Q_{2.50}=7+(\frac{2}{4})*(10-7)=7+0.50*(3)=7+1.50=8.50

Therefore, we get as a result 14 for Q3 position:
Q_{3}=Q_{7.50}=13+(\frac{2}{4})*(15-13)=13+0.50*(2)=13+1=14

Therefore, we get as a result 11 for Q2 position:
Q_{2}=Q_{5}=11

Therefore, the InterQuartile Range can be described by this interval: “8.50-14″ for the given arithmetic set, while its value is 5.50: IQR=14-8.50=5.50

Generalizing the Formula for finding the (Decimal) position between two numbers in a given dataset
Generally, the formula for finding the (Decimal) position between two numbers in a given dataset can be the following one:

X=L+(\frac{a}{b})*(H-L)

Explanation
The X denotes the value that we are searching for.
The L is the Lowest value between two given numbers
The H is the Highest value between two given numbers
The \frac{a}{b} represents the fraction that will multiply the “difference” result between two given numbers:
——–For values that have no decimals, the fraction equals to “0”: 0
——–For values that have decimal point of .25, it takes the form of: \frac{1}{4}
——–For values that have decimal point of .50, it takes the form of: \frac{2}{4} and
——–For values that have decimal point of .75, it takes the form of: \frac{3}{4}.

Both forms are equivalent and can be used interchangeably.

Results – Explanation
Both methods produced the same results for the 2nd Arithmetic set (n=9) but they did not produced exactly the same results for the 1st Arithmetic set (n=10).

interquartile_range_formula_All_results

Method A – Median
For an Even number of values in a dataset, we had as a result (n=10):
IQR=15-10=5
For an Odd number of values in a dataset, we had as a result (n=9):
IQR=14-8.5=5.5

Method B – Statistical formula
For the 1st Arithmetic set, we had as a result (n=10):
IQR=15-9.25=5.75
For the 2nd Arithmetic set, we had as a result (n=9):
IQR=14-8.50=5.50

Note that other methods and formulas also exist for calculating the value or the -iles positions.

The below table summarizes all the results. Specifically, it presents the values of InterQuartile Range, as well the values of the First Quartile (Q1), Second Quartile (Q2 – Median value), and Third Quartile (Q3) that were produced based on Method A: Median and Method B: Statistical Formula for both Arithmetic sets: 1st: (n=9) and 2nd :(n=10).

Arithmetic SetQ1 and Q3 positions
Q1Q2 - MedianQ3IQR

Method A:
"Median"
1st:(n=10)
5,7,10,10,11,13,13,15,15,18
1012155.00
2nd:(n=9)
5,7,10,10,11,13,13,15,15
8.5011145.50

Method B: "Statistical Formula"
1st:(n=10)
5,7,10,10,11,13,13,15,15,18
2.75 and 8.259.2512155.75
2nd:(n=9)
5,7,10,10,11,13,13,15,15
2.50 and 7.508.5011145.50