The interquartile gap (in English IQR) is used in statistical analysis as an aid to draw conclusions about a given set of data. Being able to exclude most anomalous elements, the IQR is often used in relation to a sample of data to measure its dispersion index. Read on to find out how to calculate it.
Steps
Part 1 of 3: The Interquartile Range
Step 1. How IQR is used
Basically the IQR shows the distribution or "dispersion" of a set of numbers. The interquartile range is defined as the difference between the third and first quartiles of a data set. The lower quartile or first quartile is normally indicated with Q1, while the upper quartile or third quartile is indicated with Q3, which technically lies between the Q2 quartile and the Q4 quartile.
Step 2. Understand the meaning of quartile
To physically visualize a quartile, divide a list of numbers into four equal parts. Each of these portions of values represents a "quartile". Let's consider the following sample of values: 1, 2, 3, 4, 5, 6, 7, 8.
- The numbers 1 and 2 represent the first quartile or Q1.
- The numbers 3 and 4 represent the first quartile or Q2.
- The numbers 5 and 6 represent the first quartile or Q3.
- The numbers 7 and 8 represent the first quartile or Q4.
Step 3. Learn the formula
In order to calculate the difference between the upper and lower quartiles, i.e. calculate the interquartile gap, you need to subtract the 25th percentile from the 75th percentile. The formula in question is the following: IQR = Q3 - Q1.
Part 2 of 3: Ordering the Data Sample
Step 1. Group your data
If you need to learn how to calculate the interquartile gap for a school exam, most likely, you will be given a ready-made and orderly set of data. Let's take the following sample of numbers as an example: 1, 4, 5, 7, 10. It is also possible that you need to extract and sort the data of your sample of values directly from the problem text or from some kind of table. Make sure the data provided is of the same nature. For example, the number of eggs present in each nest of the bird population used as a sample or the number of parking spaces reserved for each house in a particular neighborhood.
Step 2. Sort your details in ascending order
In other words, it organizes the set of values so that they are sorted starting from the smallest. Refer to the following examples:
- Data sample having an even number of elements (Group A): 4, 7, 9, 11, 12, 20.
- Data sample having an odd number of elements (Group B): 5, 8, 10, 10, 15, 18, 23.
Step 3. Divide the data sample in half
To do this, you must first find the midpoint of your set of values, that is, the number or set of numbers that are exactly in the center of the ordered distribution of the sample in question. If you are looking at a set of numeric values that contains an odd number of elements, you need to choose exactly the middle element. Conversely, if you are looking at a set of numeric values that contains an even number of elements the average value will be halfway between the two median elements of the set.
- In the example Group A the median lies between 9 and 11: 4, 7, 9 | 11, 12, 20.
- In the example Group B the median value is (10): 5, 8, 10, (10), 15, 18, 23.
Part 3 of 3: Calculating the Interquartile Range
Step 1. Calculate the median relative to the lower and upper halves of your dataset
The median is the mean value or number that lies at the center of an ordered distribution of values. In this case you are not looking for the median of the entire dataset, but you are looking for the median of the two subgroups into which you split the original sample. If you have an odd number of values, do not include the median element in the median calculation. In our example, when you calculate the median of Group B, you don't have to include either of the two numbers 10.
-
Example Group A:
- Median of the lower subgroup = 7 (Q1)
- Median of the upper subgroup = 12 (Q3)
-
Example group B
- Median of the lower subgroup = 8 (Q1)
- Median of the upper subgroup = 18 (Q3)
Step 2. Knowing that IQR = Q3 - Q1, perform the subtraction
Now that we know how many numbers are between the 25th and 75th percentiles, we can use this figure to understand how they are distributed. For example, if an exam gave a result of 100 and the interquartile gap for the scores is 5, you can deduce that most people took it having a very similar understanding of the subject in question because the scores are spread over a narrow range. of values. However, if the IQR was 30, you might start focusing on why some people scored so high and others so low.
- Example group A: 12 - 7 = 5
- Example group B: 18 - 8 = 10